【发布时间】:2012-11-29 15:40:43
【问题描述】:
我有一个 Mageneto 1.4 安装,当订单被搁置时会发送一封定制的电子邮件。这一切都很完美,但它只会发送英文电子邮件。当订单从英语和德语商店进来时,他们仍然会收到英语电子邮件。
我目前使用的holdAction方法是这样的:
public function holdAction()
{
if ($order = $this->_initOrder()) {
try {
$order->hold()
->save();
$this->_getSession()->addSuccess(
$this->__('Order was successfully put on hold.')
);
$emailTemplate = Mage::getModel('core/email_template')
->loadDefault('customer_payment_declined');
$emailTemplateVariables = array();
$emailTemplateVariables['order'] = $order;
$emailTemplateVariables['customername'] = $order->getCustomerName();
$processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);
$emailTemplate->setSenderName('example.com');
$emailTemplate->setSenderEmail('customerservice@example.com');
$emailTemplate->setTemplateSubject('Your order – '.$order->getIncrementId());
$emailTemplate->send($order->getCustomerEmail(),$order->getCustomerName(), $emailTemplateVariables);
}
catch (Mage_Core_Exception $e) {
$this->_getSession()->addError($e->getMessage());
}
catch (Exception $e) {
$this->_getSession()->addError($this->__('Order was not put on hold.'));
}
$this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
}
}
我尝试通过多种方式传递语言环境,但我没有任何运气。
有什么建议吗?
【问题讨论】:
-
你找到答案了吗?
标签: email magento locale magento-1.4 transactional-email