这是一段可以帮助您的代码:
public function sendMail() {
$mailTemplate = Mage::getModel('core/email_template');
$template = Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE); // template id of email template
$email = Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT); // recipient example: example@yahoo.com
$mailTemplate->setDesignConfig(array('area'=>'frontend'))
->sendTransactional(
$template,
Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY),
$email,
null,
array(
'subject' => $this->getSubject(),
'line' => $this->getLine(),
'message' => $this->getMessage()
)
);
$translate->setTranslateInline(true);
return $this;
}
的数组
array(
'subject' => $this->getSubject(),
'line' => $this->getLine(),
'message' => $this->getMessage()
)
可以通过 {{var subject}} {{var line}} {{var message}} 获取
那么如何获取 shippingMethod 呢?
您必须先获取运输方式的模型并加载运输方式,然后将其设置为数组。