/**
  * Form submission of new/edit contact is processed.
  *
  * @access public
  * @return None
  */
 function postProcess()
 {
     $queue_id = $this->get('queue_id');
     $job_id = $this->get('job_id');
     $hash = $this->get('hash');
     $emails = array();
     for ($i = 0; $i < 5; $i++) {
         $email = $this->controller->exportValue($this->_name, "email_{$i}");
         if (!empty($email)) {
             $emails[] = $email;
         }
     }
     foreach ($emails as $email) {
         $result = crm_mailer_event_forward($job_id, $queue_id, $hash, $email);
     }
 }
Exemple #2
0
 public function mailer_event_forward($key, $job, $queue, $hash, $email)
 {
     $this->verify($key);
     return crm_mailer_event_forward($job, $queue, $hash, $email);
 }
Exemple #3
0
 /**
  * Form submission of new/edit contact is processed.
  *
  * @access public
  * @return None
  */
 public function postProcess()
 {
     $queue_id = $this->get('queue_id');
     $job_id = $this->get('job_id');
     $hash = $this->get('hash');
     $formValues = $this->controller->exportValues($this->_name);
     $params = array();
     $params['body_text'] = $formValues['forward_comment'];
     $html_comment = $formValues['html_comment'];
     $params['body_html'] = str_replace('%7B', '{', str_replace('%7D', '}', $html_comment));
     $emails = array();
     for ($i = 0; $i < 5; $i++) {
         $email = $this->controller->exportValue($this->_name, "email_{$i}");
         if (!empty($email)) {
             $emails[] = $email;
         }
     }
     $forwarded = null;
     foreach ($emails as $email) {
         $result = crm_mailer_event_forward($job_id, $queue_id, $hash, $email, $this->_fromEmail, $params);
         if ($result) {
             $forwarded++;
         }
     }
     $status = ts('Mailing is not forwarded to the given email address.', array('count' => count($emails), 'plural' => 'Mailing is not forwarded to the given email addresses.'));
     if ($forwarded) {
         $status = ts('Mailing is forwarded successfully to %count email address.', array('count' => $forwarded, 'plural' => 'Mailing is forwarded successfully to %count email addresses.'));
     }
     require_once 'CRM/Utils/System.php';
     CRM_Utils_System::setUFMessage($status);
     // always redirect to front page of url
     $session =& CRM_Core_Session::singleton();
     $config =& CRM_Core_Config::singleton();
     $session->pushUserContext($config->userFrameworkBaseURL);
 }