2017-12-04 13:45:13 +01:00
|
|
|
<?php
|
|
|
|
|
2019-08-06 06:57:59 +02:00
|
|
|
include "ninjamail.class.php";
|
2017-12-04 13:45:13 +01:00
|
|
|
|
2019-08-06 06:57:59 +02:00
|
|
|
// Mail
|
|
|
|
$mail = new ninjaMailSend('https://admin.dimail.hu', 'API_KEY');
|
|
|
|
$mail->to('webmaster@example.org');
|
|
|
|
$mail->subject('Hello');
|
|
|
|
$mail->message('HTML_CONTENT', 'TEXT_CONTENT');
|
|
|
|
var_dump($mail->send());
|
2017-12-04 13:45:13 +01:00
|
|
|
|
2019-08-06 06:57:59 +02:00
|
|
|
// Newsletter
|
|
|
|
$newsletter = new ninjaMailNewsletter('https://admin.dimail.hu', 'API_KEY');
|
|
|
|
$newsletter->subject('New subject');
|
|
|
|
$newsletter->message('HTML_CONTENT', 'TEXT_CONTENT OR NULL');
|
2017-12-04 13:45:13 +01:00
|
|
|
|
2019-08-06 06:57:59 +02:00
|
|
|
if ($newsletter->update() && $newsletter->send())
|
|
|
|
echo "updated & sent\n";
|
2017-12-04 13:45:13 +01:00
|
|
|
|
2019-08-06 06:57:59 +02:00
|
|
|
// Stats
|
|
|
|
$stat = new ninjaMailStatistics('https://admin.dimail.hu', 'API_KEY');
|
|
|
|
print_r($stat->get(3512201));
|