用户注册后是否需要邮件验证,如果需要的话用户注册的邮件没有发送成功,那么这个用户是无法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/里