make() public method

return a mailing object (array)
public make ( $in = [], $current = FALSE )
Beispiel #1
0
 // create temp subscriber
 $subscriber = array('email' => $_POST['email'], 'registered' => time(), 'ip' => $_SERVER['REMOTE_ADDR'], 'status' => 0, 'data' => $_POST['d']);
 Pommo_Validate::subscriberData($subscriber['data'], array('active' => FALSE, 'ignore' => TRUE, 'log' => false));
 $key = Pommo_Subscribers::add($subscriber);
 if (!$key) {
     $logger->addErr('Unable to Add Subscriber');
 } else {
     // temp subscriber created
     $state['tally'] = 1;
     $state['group'] = Pommo::_T('Test Mailing');
     if ($state['ishtml'] == 'off') {
         $state['body'] = $state['altbody'];
         $state['altbody'] = '';
     }
     // create mailing
     $mailing = Pommo_Mailing::make(array(), TRUE);
     $state['status'] = 1;
     $state['current_status'] = 'stopped';
     $state['command'] = 'restart';
     $state['charset'] = $state['list_charset'];
     $mailing = Pommo_Helper::arrayIntersect($state, $mailing);
     $code = Pommo_Mailing::add($mailing);
     // populate queue
     $queue = array($key);
     if (!Pommo_Mail_Ctl::queueMake($queue)) {
         $logger->addErr('Unable to Populate Queue');
     } else {
         if (!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl . 'ajax/mailings_send4.php?test=TRUE&code=' . $code)) {
             $logger->addErr('Unable to spawn background mailer');
         } else {
             $smarty->assign('sent', $_POST['email']);
Beispiel #2
0
 Pommo_Validate::subscriberData($subscriber['data'], array('active' => false, 'ignore' => true, 'log' => false));
 $key = Pommo_Subscribers::add($subscriber);
 if (!$key) {
     $logger->addErr('Unable to Add Subscriber');
 } else {
     // temp subscriber created
     $state['tally'] = 1;
     $state['group'] = _('Test Mailing');
     if ('off' == $state['ishtml']) {
         $state['body'] = $state['altbody'];
         $state['altbody'] = '';
     } else {
         $state['ishtml'] = 'on';
     }
     // create mailing
     $mailing = Pommo_Mailing::make(array(), true);
     $state['status'] = 1;
     $state['current_status'] = 'stopped';
     $state['command'] = 'restart';
     $state['charset'] = $state['list_charset'];
     $mailing = Pommo_Helper::arrayIntersect($state, $mailing);
     $code = Pommo_Mailing::add($mailing);
     // populate queue
     $queue = array($key);
     if (!Pommo_Mail_Ctl::queueMake($queue)) {
         $logger->addErr('Unable to Populate Queue');
     } else {
         if (!Pommo_Mail_Ctl::spawn(Pommo::$_baseUrl . 'ajax/mailings_send4.php?test=TRUE&code=' . $code)) {
             $logger->addErr('Unable to spawn background mailer');
         } else {
             $view->assign('sent', $_POST['email']);