public function send()
    {
        $emailTemplate = Mage::getModel('core/email_template');
        // Send all emails from corresponding list
        while (!empty($this->_emailInfos)) {
            $emailInfo = array_pop($this->_emailInfos);
            // Handle "Bcc" recepients of the current email
            $emailTemplate->addBcc($emailInfo->getBccEmails());
            // Set required design parameters and delegate email sending to Mage_Core_Model_Email_Template
            $emailTemplate->setDesignConfig(array('area' => 'frontend', 'store' => $this->getStoreId()))
                ->sendTransactional(
                $this->getTemplateId(),
                $this->getSender(),
                $emailInfo->getToEmails(),
                $emailInfo->getToNames(),
                $this->getTemplateParams(),
                $this->getStoreId()
            );
        }
        return $this;
    }

  (1) $this->getTemplateId()

  <global>

    <template>
             <email>
                  <customer_create_account_email_template translate="label" module="customer">
                      <label>New account</label>
                          <file>account_new.html</file>
                          <type>html</type>

                  </customer_create_account_email_template>

      </email>

    <template>

</global>

  $this->getTemplateId()表示上述配置中的customer_create_account_email_template

  (2) $this->getStoreId()

    系统会根据$this->getStoreId()的值调用locale下的不同邮件模板。默认调用app/locale/en_US/template/email下的邮件模板

  (3) $this->getTemplateParams()

    邮件模板中的变量都来源于此

相关文章:

  • 2021-12-20
  • 2021-04-11
  • 2021-07-17
  • 2022-12-23
  • 2022-02-19
  • 2021-08-03
  • 2021-05-21
  • 2021-04-22
猜你喜欢
  • 2022-12-23
  • 2021-05-23
  • 2021-09-01
  • 2021-09-08
  • 2021-10-30
  • 2021-09-14
  • 2021-07-12
相关资源
相似解决方案