我有一個Mageneto 1.4安裝程序,可在訂單處於保留狀態時發送自定義電子郵件。這一切都完美,但它只會發送英文電子郵件。當訂單從英國和德國商店進來時,他們仍然發送英文電子郵件。在Magento中設置電子郵件模板的語言環境
的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('[email protected]');
$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()));
}
}
我試圖通過傳遞語言環境中的各種方法,但我沒有任何運氣。
有什麼建議嗎?
您是否找到了答案? – Guus
不怕@古斯 – hammygoonan