Ejemplo n.º 1
0
 //verify the queue item before further processing.
 //we have found cases where users have taken away access to email templates while them message is in queue.
 if (empty($row['campaign_id'])) {
     $GLOBALS['log']->fatal('Skipping emailman entry with empty campaign id' . print_r($row, true));
     continue;
 }
 if (empty($row['marketing_id'])) {
     $GLOBALS['log']->fatal('Skipping emailman entry with empty marketing id' . print_r($row, true));
     continue;
     //do not process this row .
 }
 //fetch user that scheduled the campaign.
 if (empty($current_user) or $row['user_id'] != $current_user->id) {
     $current_user->retrieve($row['user_id']);
 }
 if (!$emailman->verify_campaign($row['marketing_id'])) {
     $GLOBALS['log']->fatal('Error verifying templates for the campaign, exiting');
     continue;
 }
 //verify the email template too..
 //find the template associated with marketing message. make sure that template has a subject and
 //a non-empty body
 if (!isset($template_status[$row['marketing_id']])) {
     if (!class_exists('EmailMarketing')) {
     }
     $current_emailmarketing = new EmailMarketing();
     $current_emailmarketing->retrieve($row['marketing_id']);
     if (!class_exists('EmailTemplate')) {
     }
     $current_emailtemplate = new EmailTemplate();
     $current_emailtemplate->retrieve($current_emailmarketing->template_id);
Ejemplo n.º 2
0
 public function testverify_campaign()
 {
     $emailMan = new EmailMan();
     $result = $emailMan->verify_campaign('');
     $this->assertEquals(false, $result);
 }