我添加了这个用于发送邮件,邮件正在运行,但模板没有显示在邮件中。 seller_mail_template正在邮件中发送,但Seller_registration_template不是。
$loadTemplateVariables='seller_mail_template';
$this->commonmail($email,$bccEmail='false',$loadTemplateVariables,$templateSubject,$emailTemplateVariables);
$loadTemplateVariables ='seller_registration_template';
$this->commonmail($email,$bccEmail='false',$loadTemplateVariables,$templateSubject,$emailTemplateVariables);
function commonmail($email,$bccEmail='false',$loadTemplateVariables,$templateSubject,$emailTemplateVariables){
$emailTemplate = Mage::getModel('core/email_template')->loadDefault($loadtemplate);
if($bccEmail){
$emailTemplate->addBcc($bccEmail);
}
$emailTemplate->setTemplateSubject($templateSubject);
$sData['email'] = Mage::getStoreConfig('trans_email/ident_custom1/email');
$sData['name'] = Mage::getStoreConfig('trans_email/ident_custom1/name');
$emailTemplate->setSenderName($sData['name']);
$emailTemplate->setSenderEmail($sData['email']);
try{
$emailTemplate->send($email,Mage::app()->getStore()->getName(),$emailTemplateVariables);
}catch(exception $e){Mage::log($e,null,'system.log');}
}
} 获得例外:
#0 /var/www/magento/magento/includes/src/Zend_Mail_Transport_Abstract.php(348): Zend_Mail_Transport_Sendmail->_sendMail()
#1 /var/www/magento/magento/includes/src/Zend_Mail.php(1194): Zend_Mail_Transport_Abstract->send(Object(Zend_Mail))
#2 /var/www/magento/magento/includes/src/Mage_Core_Model_Email_Template.php(454): Zend_Mail->send()
#3/var/www/magento/magento/includes/src/J2t_Smsgateway_Model_Emailtemplate.php(23): Mage_Core_Model_Email_Template->send('__________@gm...', 'Default Store V...', Array)
#4/var/www/magento/magento/app/code/local/Seller/SellerDirectory/controllers/IndexController.php(182): J2t_Smsgateway_Model_Emailtemplate->send('__________@gm...', 'Default Store V...', Array)
#5/var/www/magento/magento/app/code/local/Seller/SellerDirectory/controllers/IndexController.php(86): Seller_SellerDirectory_IndexController->commonmail('__________@gm...', 'false', 'seller_registra...', 'Seller Registra...', Array)
#6 /var/www/magento/magento/includes/src/__default.php(419): Seller_SellerDirectory_IndexController->responseAction()
#7 /var/www/magento/magento/includes/src/__default.php(18718): Mage_Core_Controller_Varien_Action->dispatch('response')
#8 /var/www/magento/magento/includes/src/__default.php(18252): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 /var/www/magento/magento/includes/src/__default.php(20852): Mage_Core_Controller_Varien_Front->dispatch()
#10 /var/www/magento/magento/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#11 /var/www/magento/magento/index.php(87): Mage::run('default', 'store')
#12 {main}
需要帮助,卡住无法调试......