Source for file Email.php

Documentation is available at Email.php

  1. <?php
  2. /**
  3.  *  Magentron EmailImages Extension
  4.  *
  5.  *  @category   Magentron
  6.  *  @package    Magentron_EmailImages
  7.  *  @author     Jeroen Derks
  8.  *  @copyright  Copyright (c) 2011 Jeroen Derks http://www.magentron.com
  9.  *  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  10.  */
  11. class Mage_Advancedsmtp_Email.html">Magentron_EmailImages_Model_Extensions_Mage_Advancedsmtp_Email extends Mage_Advancedsmtp_Model_Email
  12. {
  13.     public function Mage_Advancedsmtp_Email.html#methodsend">send()
  14.     {
  15.         if (!Mage::getStoreConfig('advancedsmtp/settings/enabled'))
  16.         {
  17.             return parent::send();
  18.         }
  19.         
  20.         if (Mage::getStoreConfigFlag('system/smtp/disable')) {
  21.             return $this;
  22.         }
  23.         
  24.         /** @TODO check if it would be safe to set template as context on mail instance */
  25.         /** @var    $mail   Magentron_EmailImages_Model_Mail */
  26.         $mail Mage::getModel('emailimages/mail');
  27.  
  28.         if (strtolower($this->getType()) == 'html'{
  29.             $mail->setBodyHtml($this->getBody());
  30.         }
  31.         else {
  32.             $mail->setBodyText($this->getBody());
  33.         }
  34.         $transport Mage::helper('advancedsmtp')->getTransport();
  35.         $mail->setFrom($this->getFromEmail()$this->getFromName())
  36.             ->addTo($this->getToEmail()$this->getToName())
  37.             ->setSubject($this->getSubject());
  38.             
  39.         
  40.         $mail->send($transport);
  41.  
  42.         return $this;
  43.     }
  44. }

Documentation generated on Fri, 09 Oct 2015 03:37:09 +0200 by phpDocumentor 1.4.4