1

I have two 'special' products that when ordered should send a custom email (in place of the standard order confirmation email).

An Observer is set up for the sales_order_place_after event but not sure how to change the email template for the order.

How do I change the email template for this particular order.

  • What type of customization do you want to do, is this just simple text changes or more complex design changes? – Renon Stewart Sep 23 '14 at 19:04
  • more complex, but open to just some text changes for now – pzirkind Sep 23 '14 at 19:26
2

To send different order conformation email depending on specific criteria you would either have to :

  1. Rewrite sendNewOrderEmail() in Mage_Sales_Model_Order and add logic to check the template

  2. Disable magento "order confirmation email" in system config, then create a custom module to send your email by coping logic from sendNewOrderEmail() using event/observer

  3. For simple text changes, you could use template logic {{if order.customer_group_id}} or {{depend order.customer_group_id}} but they seem to only evaluate true/false condition, therefore for more advance logic you could include a block

{{block type='core/template' area='frontend' template='sales/custom_logic.phtml' order=$order}}

In custom_logic.phtml

<?php
  $order = $this->getOrder()

  if($order->getCustomerGroupId() == 1){
     ///do
   ....

See Magento Email Template If Statements

  • great answer! really appreciate the breakdown of options – pzirkind Sep 24 '14 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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