Magento 邮件模板以及发送邮件细节

用户注册后是否需要邮件验证,如果需要的话用户注册的邮件没有发送成功,那么这个用户是无法LOGIN的,以下为设置部分:
system->configure->customers-customer configuration->create new account options这个里的Require Emails Confirmation 为No

 

邮件的实现过程:
拿order为例:
app/code/core/Mage/Sales/Model/Order.php
sendNewOrderEmail

$mailTemplate = Mage::getModel('core/email_template');
$template = Mage::getStoreConfig(self::XML_PATH_UPDATE_EMAIL_GUEST_TEMPLATE, $this->getStoreId());
->sendTransactional()
app/code/core/Mage/Core/Model/Email/Template.php
sendTransactional(){
  $this->load($templateId);


}

//Load的时候进行了邮件subject的设置

 $templateText = Mage::app()->getTranslator()->getTemplateFile(
            $data['file'], 'email', $locale
        );

        if (preg_match('/<!--@subject/s*(.*?)/s*@-->/', $templateText, $matches)) {
           $this->setTemplateSubject($matches[1]);
//这个东西就在邮件模板的html文件中是:<!--@subject Welcome, {{var customer.name}}! @-->
           $templateText = str_replace($matches[0], '', $templateText);
        }

        /**
         * Remove comment lines
         */
        $templateText = preg_replace('#/{/*.*/*/}#suU', '', $templateText);

        $this->setTemplateText($templateText);
        $this->setId($templateId);
而邮件的模板的定义是在:/app/code/core/Mage/Sales/etc/config.xml

 <sales_email>
            <order>
                <enabled>1</enabled>
                <template>sales_email_order_template</template>
                <guest_template>sales_email_order_guest_template</guest_template>
                <identity>sales</identity>
                <copy_method>bcc</copy_method>
            </order>

实际上这些文件在
app/locale/en_US/template/email/里

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值