Пример #1
0
 public function testEmail()
 {
     $channels = array();
     $channels[] = \Native5\Services\Messaging\Notifier::TYPE_EMAIL;
     $email = new \Native5\Services\Messaging\MailMessage();
     $email->setSubject('Test E-mail : Subject 001');
     $email->setBody('Testing E-mail Sending works.');
     $email->setRecipients(array('*****@*****.**', '*****@*****.**'));
     //$email->addAttachment(__FILE__);
     //$email->addAttachment(__DIR__.'/../../Application.php');
     //$email->addAttachment('/home/shamik/Work/Native5_Packages/SDKs/native5-sdk-services-php/LICENSE');
     //$email->addAttachment('/home/shamik/Work/Native5_Packages/SDKs/native5-sdk-services-php/VERSION');
     $mailService = \Native5\Services\Messaging\NotificationService::instance();
     $mailStatus = $mailService->sendNotification($channels, $email);
     $GLOBALS['logger']->info("Got mailStatus: " . print_r($mailStatus, 1));
 }
Пример #2
0
 private static function _createEmail($receipients, $subject, $body)
 {
     $email = new \Native5\Services\Messaging\MailMessage();
     $email->setSubject($subject);
     $email->setBody($body);
     $email->setRecipients($receipients);
     return $email;
 }