Managing Transactional E-mails in Magento

How to manage transactional emails in Magento.

By Suada Cane

Transactional E-mails are sent out at multiple steps of a transaction.  This includes things like an order being placed or a payment going through or when the order is shipped.

Magento comes with several default Transactional E-mails with default text and variables.

To change these, log into the admin and head over to System > Transactional E-mails.

You might notice that there’s barely any e-mails or that you’re not seeing any of the ones you normally see here.
Those files are stored in the system, and it’s in better practice to update the e-mails here than to write over the defaults.

Let’s click Add New Template.

Under Load default template, you’ll see that you can actually load those default emails we were talking about under Template.

In this example, we’ll select New Order” and click Load Template.

As you can see, it’s pushed all this code and text into the Template Information tab.

Fill out the Template Name. I’d suggest something to keep it noticeable amongst all the emails, like “Custom_New Order” or “[[Your Store]]_New Order”.

Anything with the curly brackets like {{var store.getFrontendName()}} is a variable built into Magento.  What this is, is basically a placeholder that pulls a value from the system and displays it as text.  {{var store.getFrontendName()}} will show your store’s name. So, if my store is named “MyStore”, the email’s Subject Line (controlled by Template Subject as seen here) will show “MyStore: New Order# . . .”.

To see a list of available variables, you can use the Insert Variable button, under the Template Subject and above the Template Content. 
Note: The variable you select will show up in Template Content. You can copy it and paste it into the Template Subject.

Under Template Contact you can change your text and add HTML as you see fit.  After that’s all added, you can preview the email by selecting Preview Template in the upper right-hand corner.

Please note that any variables you add will not be visible in the template — the only way to accurately test them is to trigger the email to send to an e-mail address that you can access.

Finally, we have to set our new E-mails to send at specific steps in the process.

To do this, go to System > Config > SALES > Sales E-mails 

You’ll find tabs with titled with specific steps of a transaction here. Open them up and you’ll find something like this

From here, you can select the e-mail address to send from, as well as which template to use.