我正在编写自定义电子邮件发送脚本,该脚本将获取客户详细信息并将其传递到电子邮件模板中。
foreach ($emails as $email) {
//send feedback
$customer = Mage::getModel("customer/customer");
$customer->loadByEmail($email);
$emailTemplate = Mage::getModel('core/email_template')->loadByCode('e-mail templaet code');
$emailTemplateVariables = array();
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
$emailTemplate->setSenderName('Sender name');
$emailTemplate->setSenderEmail('sender@example.com');
$emailTemplate->setTemplateSubject("email subject");
$emailTemplate->send('mail@example.com','Some name Some surname', $emailTemplateVariables);
}
有什么办法可以将所有变量从 $customer 传递到$emailTemplateVariables
?
并且这些变量将{{var customer.email}}
在电子邮件模板中使用。