Exemplo n.º 1
0
 /**
  * Retrieve mail object instance
  *
  * @return Zend_Mail
  */
 public function getMail()
 {
     if (!Mage::getStoreConfigFlag(self::XML_PATH_ENABLED)) {
         return parent::getMail();
     }
     if (is_null($this->_mail)) {
         $this->_mail = Mage::getModel('zenc_emaillogger/zend_mail_logger');
     }
     return $this->_mail;
 }
Exemplo n.º 2
0
 public function getMail($storeId = null)
 {
     if (is_null($this->_mail)) {
         $this->_mail = parent::getMail();
         $transport = $this->_getTransport($storeId);
         if ($transport) {
             $this->_mail->setDefaultTransport($transport);
         }
     }
     return $this->_mail;
 }
Exemplo n.º 3
0
 public function getMail()
 {
     //Check if should use Mandrill Transactional Email Service
     if (FALSE === Mage::helper('mandrill')->useTransactionalService()) {
         return parent::getMail();
     }
     if (is_null($this->_mandrill)) {
         $this->_mandrill = Mage::helper('mandrill')->api();
         $this->_mandrill->setApiKey(Mage::helper('mandrill')->getApiKey());
     }
     return $this->_mandrill;
 }
 /**
  * 
  * @param type $subject
  * @param type $message
  * @param type $to
  * @param type $toName
  */
 public function loginRadiusEmail($subject, $message, $to, $toName)
 {
     $storeName = Mage::app()->getStore()->getGroup()->getName();
     $mailObj = new Mage_Core_Model_Email_Template();
     $mail = $mailObj->getMail();
     $mail->setBodyHtml($message);
     //for sending message containing html code
     $mail->setFrom("Owner", $storeName);
     $mail->addTo($to, $toName);
     $mail->setSubject($subject);
     try {
         $mail->send();
     } catch (Exception $ex) {
         Mage::logException($ex);
     }
 }
Exemplo n.º 5
0
 /**
  * @return Mandrill_Message|Zend_Mail
  */
 public function getMail()
 {
     $storeId = Mage::app()->getStore()->getId();
     if (!Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::ENABLE, $storeId)) {
         return parent::getMail();
     }
     if ($this->_mail) {
         return $this->_mail;
     } else {
         $storeId = Mage::app()->getStore()->getId();
         Mage::helper('ebizmarts_mandrill')->log("store: {$storeId} API: " . Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::APIKEY, $storeId));
         $this->_mail = new Mandrill_Message(Mage::getStoreConfig(Ebizmarts_Mandrill_Model_System_Config::APIKEY, $storeId));
         return $this->_mail;
     }
 }
Exemplo n.º 6
0
 /**
  * @param Mage_Core_Model_Email_Template $mailTemplate
  * @param string $replyTo
  *
  * @return $this
  */
 protected function _setReplyTo($mailTemplate, $replyTo)
 {
     try {
         $mailTemplate->setReplyTo($replyTo);
     } catch (Exception $e) {
         $mailTemplate->getMail()->setReplyTo($replyTo);
     }
     return $this;
 }
 public function loginRadiusEmail($subject, $message, $to, $toName)
 {
     $storeName = Mage::app()->getStore()->getGroup()->getName();
     //$mail = new Zend_Mail('UTF-8'); //class for mail
     $mailObj = new Mage_Core_Model_Email_Template();
     $mail = $mailObj->getMail();
     $mail->setBodyHtml($message);
     //for sending message containing html code
     $mail->setFrom("Owner", $storeName);
     $mail->addTo($to, $toName);
     //$mail->addCc($cc, $ccname);    //can set cc
     //$mail->addBCc($bcc, $bccname);    //can set bcc
     $mail->setSubject($subject);
     try {
         $mail->send();
     } catch (Exception $ex) {
     }
 }