new example

This commit is contained in:
4026 2019-08-06 04:57:59 +00:00
parent 610c560eb2
commit 4cedaa54f0

View File

@ -1,21 +1,22 @@
<?php <?php
$post = [ include "ninjamail.class.php";
'list' => 23,
'name' => 'Subscriber John',
'email' => 'john@subscriber.aa',
'activated' => 1
];
$ch = curl_init('http://hirlevel.sandros.eu/a/subscribe?key=f953d4b526fdffda0d58bcd39fbbab29800f31ec8c6bcff53af359cd6528337e5bda05f3faf3f2beef4fb1cc8eeee906be67d6bc7c4b04af61dfc239d6b079e1'); // Mail
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $mail = new ninjaMailSend('https://admin.dimail.hu', 'API_KEY');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $mail->to('webmaster@example.org');
$mail->subject('Hello');
$mail->message('HTML_CONTENT', 'TEXT_CONTENT');
var_dump($mail->send());
// execute! // Newsletter
$response = curl_exec($ch); $newsletter = new ninjaMailNewsletter('https://admin.dimail.hu', 'API_KEY');
$newsletter->subject('New subject');
$newsletter->message('HTML_CONTENT', 'TEXT_CONTENT OR NULL');
// close the connection if ($newsletter->update() && $newsletter->send())
curl_close($ch); echo "updated & sent\n";
// lets see // Stats
var_dump($response); $stat = new ninjaMailStatistics('https://admin.dimail.hu', 'API_KEY');
print_r($stat->get(3512201));