示例#1
0
 /**
  * Forward email
  * 
  * @param Mzax_Bounce_Message $message
  * @return boolean
  */
 public function forward(Mzax_Bounce_Message $message = null)
 {
     if (!$message) {
         $message = new Mzax_Bounce_Message($this->getRawData());
     }
     $mail = $message->forward();
     $canSend = false;
     foreach ($this->getForwardToEmails() as $email) {
         if (Zend_Validate::is($email, 'EmailAddress')) {
             $mail->addTo($email);
             $canSend = true;
         }
     }
     if (!$canSend) {
         return false;
     }
     $sender = $this->getSender();
     $mail->setFrom($sender['email'], $sender['name']);
     $mail->addHeader('X-Mailer', 'Mzax-Emarketing ' . Mage::helper('mzax_emarketing')->getVersion());
     $mail->addHeader('X-Originating-IP', Mage::app()->getRequest()->getServer('SERVER_ADDR'));
     $this->setMailTransport(null);
     Mage::dispatchEvent('mzax_emarketing_inbox_email_forward', array('mail' => $mail, 'email' => $this, 'message' => $message));
     // in case an event observer has set one
     $transport = $this->getMailTransport();
     $mail->send($transport);
     return true;
 }