I was wondering if it is possible to change the email template after the order is placed depending on a shipping or payment method. I built the observer here:



And also in the model php file:


public static function send_email($observermail)

        $event = $observermail->getEvent();
        $order = $event->getOrder();
        $customer = $order->getCustomerName();
        $email= $order->getCustomerEmail();

        $templateId = 1;

        $senderName = Mage::getStoreConfig('trans_email/ident_support/name');
        $senderEmail = Mage::getStoreConfig('trans_email/ident_support/email');
        $sender = array('name' => $senderName,
            'email' => $senderEmail);

        $storeId = Mage::app()->getStore()->getId();

        $vars = array('customerName' => $email,
            'customerEmail' => $customer);

        $translate  = Mage::getSingleton('core/translate');

            ->sendTransactional($templateId, $sender,  $email, $customer, $vars, $storeId);



I was able to send another email template when the customer places an order. But the old transactional email template is also sent to the customer (the customer gets two different emails).

How can I get the original template on this event and change it to my template....or at least disable the old email template if this shipping/payment method is used?

1 Answer 1


You can change the template by creating a template in Config -> Trasactional Email and in the model you just insert:

public static function sendEmail($observer){

     Mage::app()->getStore()->setConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_GUEST_TEMPLATE, 'yourTemplateId');


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.