I have a Mageneto 1.4 installation that sends a customised email when orders are put on hold. It all works perfectly, however it will only send English emails. When the orders come in from the English and German store they are still sent the English email.
The holdAction method I'm currently using looks like this:
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()));
}
}
I've tried passing the Locale through in a variety of ways but I'm not having any luck.
Any suggestions?