3/13/2014

How to add custom variables to new order E-mail in magento?

You can add custom variable data or something related to product's attribute in any transactional email. You also can write your custom code according to the current order id and display the required result. If you want to use new module, you can create hope for creating new module I don't need to describe the steps here.

open your layout file.xml then write below xml there

<sales_email_order_anything>
<block type="sales/order_email_items" name="anything" template="email/anyname.phtml"/>
</sales_email_order_anything>

In anyname.phtml file you can write <?php $_order = $this->getOrder(); ?> to get the order object.

Now go to order transactional email then write

{{layout handle="sales_email_order_anything" order=$order}}

Replace all anything/anyname to suitable text