23 lines
647 B
PHP
23 lines
647 B
PHP
<?php
|
|
|
|
include "ninjamail.class.php";
|
|
|
|
// 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());
|
|
|
|
// Newsletter
|
|
$newsletter = new ninjaMailNewsletter('https://admin.dimail.hu', 'API_KEY');
|
|
$newsletter->subject('New subject');
|
|
$newsletter->message('HTML_CONTENT', 'TEXT_CONTENT OR NULL');
|
|
|
|
if ($newsletter->update() && $newsletter->send())
|
|
echo "updated & sent\n";
|
|
|
|
// Stats
|
|
$stat = new ninjaMailStatistics('https://admin.dimail.hu', 'API_KEY');
|
|
print_r($stat->get(3512201));
|