Custom Transactional Emails

Custom Transactional Emails

Since transactional emails are very important for the process of online shopping you need to have them set up just the you want them and the default templates just don’t cut it. You need your own logo, email data and custom verbiage to be consistent with the image of your company.

Here how it’s done :

1. Creating custom transactional e-mails via Admin

a) In the admin panel of your magento installation go to:  System->Transactional Emails

You’ll be presented with a list of default emails.  You’ll need to create a custom email so the only way to avoid writing our custom templates from scratch is to use the existing code of the template.
Hint: If you want to see the template before copying, first click on the “Preview” button on the right.

b) To create the new template click on the “Add new template” above the “Transactional Emails” list. This is the part where Magento helps you with the option to load a deafult template for you to customize. Nice feature indeed.

Once you have loaded the deafult template give it a unique name under the “Template name”  input field by adding a prefix of your own but leaving the deafult name as well. Example:  ” mysite :: New account “.

That way you can easily spot them in the long list of default and custom emails.

Afterwards you can easily customize the verbiage and styling within the “Template subject” and “Template content”.

The “Template content” is the body of the message that the user will recieve upon transaction so be sure to change the E-mail, name of the company etc. You’ll need to upload the logo of your company in the images folder of the skin you’re using.

Once you are done with editing, save the changes and repeat the process for the rest of the email templates.

2. Assigning the templates to different stores and storeviews

Assigning is the easiest part. Just go to the System > Configuration > Sales > Sales Emails and select the corresponding template minding the configuration scope.

After you’re done with setting your new templates save the configuration by clicking on the “Save config”.

That’s it. Wise thing to do now would be to check how the emails look when received so make a test purchase to verify everything is the way it should be.

You made it all the way down here so you must have enjoyed this post! You may also like:

Enabling Multi-part MIME Emails in Magento Tomislav Nikcevski
Tomislav Nikcevski, | 3

Enabling Multi-part MIME Emails in Magento

Extending “Contact us” functionality in Magento Ivan Bernatovic
Ivan Bernatovic, | 8

Extending “Contact us” functionality in Magento

Magento’s transactional eMails do-s and don’t-s Adrian Bece
Adrian Bece, | 10

Magento’s transactional eMails do-s and don’t-s

27 comments

  1. Hi guys,

    I have a bit of a problem with transactional emails and hopefully I can get some help here.
    I am trying to create a new transactional email template.
    1. I press Add new template
    2. I choose the template I want to change from the list
    3. I press “Load template” and…
    …nothing happens as it fails to load the Template Content.
    Therefore I can`t change the code.

    Do you guys have an idea what can cause this trouble?

    Kind regards.

  2. Hi First of all, great site!
    I have been looking through the examples hoping to find a clear indication on how to solve one issue I am havving with my magento install.
    I have created custom transactional emails as described here but now I want to include the value of one custom attribute I have creatde in my products.
    I have a custom attribute called delivery time in all my products, what I would like to accomplish is having this attribute value printed out in the order email that gets sent when a customer places an order.
    I have been searching th eweb for days for a way to do this but only stumble upon very complicated examples.

    Does anybody here doen this before and point me in the right direction (or maybe a link to a good tutorial?)

    Thanx in advance an keep up the good work!

  3. Hi Zeljko,
    how can I modify Subtotal,Adjustment Fee and Grand Total label in credit memo?
    Thanks,
    Stevan

  4. Thanks for the info, this is very useful.

    Does anyone know how i could go about adding another entirely different transaction email?

    we provide send in repairs for iPods so it would be really nice if we had a item received as well as item shipped transactional email. Any idea if this is possible?

  5. The hands down best approach I have found to easing the management of these email templates is to use the ultra-handy:

    {{layout handle="your_handle"}}

    …directly in your email templates. This will call one of your layout handles added in local.xml.

    For example, you can add in a reference to an email header such as:

    (in the email template)

    {{layout handle="email_header"}}

    (in local.xml)

    <email_header>
        <block type="page/html_header" name="email_header" template="email/header.phtml"/>
    </email_header>

    Using ‘type=page/html_header’ allows you access to some of the typical header block functions, namely getLogoSrc() and getLogoAlt() so that you can just pull in your store’s logo and be done with it. You could get fancy and do some Varien_Image resizing on it, or you could just add width/height attributes to the tag and be done with it.

    This approach can greatly reduce the amount of work it takes to maintain your templates, since you can just make a change to a header/footer/etc just once and not have to reapply those changes to all the dozens of email templates provided.

  6. My Load default Template List shows blank.

    Also I think when we click on ‘Add new Template’ there should be other fields like ‘Template Name’ ‘Template Content’ ‘Locale’, etc.

    But I just find this ‘Load default Template’ drop-down which also shows blank.

    What should I check in order to get it populated with default email templates?

  7. Is it possible to add custom attributes to the new order email template?

    For example I am selling records and the name of the record could be ‘Greatest Hits’ and I need to also pull in the artist name which is set as a custom attribute for that product.

  8. English below

    Dag Erwin,

    ik heb 3 bijkomende taalpakketten geïnstalleerd via Magento Connect “NL, DE, FR” de mailings voor EN,FR,DE zijn perfect in orde maar die van NL zijn echt niet schitterend daarom heb ik de transactionele mails voor NL opnieuw gemaakt en de rest gebruik ik de standaard.
    Vertaalpakketten : voor FR/DE http://www.magentocommerce.com/magento-connect/Gui/extension/364/magento-community-modules–dutch-netherlands-language-pack

    Bijkomend voor NL : MagAddons.com

    I have 3 additional language packs installed via Magento Connect ‘NL, DE, FR “the mailings for EN, FR, DE are perfectly fine but that of NL are really not that great so I have the transactional emails for NL recreated and the rest use I stand.
    Translation Packages: For FR / DE http://www.magentocommerce.com/magento-connect/Gui/extension/364/magento-community-modules–dutch-netherlands-language-pack

    Additional for NL: MagAddons.com

  9. How can I make the emails:

    Order confirmation
    Invoice
    Shipping
    Credit Memo, etc …

    Supported by different languages? When someone orders a product in French or German store view, Magento sends an email with the correct language when i use the default template, but when i add a transactual mail basead on a Magento template and just change my logo, mail, phonenr … Magento dos not translate the email anymore? Any Idea?

    Thanks!!
    Peter

  10. Does anyone have a default/original html codes for a new order and shipment for a transactional email? I updated it and now when a customer receives a confirmation, the order/payment box doesn’t show. Any info is appreciated! Thanks!

  11. Hey, I’m trying to add more than one recepients to the Contact Us e-mail form. Do you know how I would go about doing that in the back end?

    I tried adding two in the Configuration – > Contacts settings, but it’s not working. Any special way I have to enter it?

  12. I personally find this bit tedious as you have to create the new templates and search though the admin to figure out where to assign these and it can be difficult to know you’ve re-assigned them all (some are in Sales Emails, some are in Customer Configuration, others in Payments etc).

    Previously I’ve edited the templates as R Graham mentioned (bad I know) but it’s the easiest way I’ve found to make sure I get them all.

    Does anyone know where to find a definitive list of which email templates are assigned where?

  13. I thought it was an excellent idea, but doesn’t seem to work for me. If I copy the ‘block’ code ( {{block type=”cms/block” block_id=”email_logo_retail”}} ) to my homepage it works but not in an email template.

    I’m running more than one store, maybe that’s something to do with it? I did make sure my static block is available to all stores.

    Anyone got any ideas?

  14. Excellent idea about the static blocks. This way if the logo changes or the phone or anything else, all you have to do is change the static block.
    Genius.

  15. Good advice, this is a key area that unfortunately could be less tedious I think.

    For me I started with some good advice on the magento forums and created a couple of static CMS blocks for the logo and contact details (email, phone).

    Then, due mainly to time constraints, I directly edited the templates located at /app/local/en_US/template/email/sales replacing the text with my static block references
    {{block type=”cms/block” block_id=”email_logo_retail”}}

    I’m relatively new to magento so not sure about these being written over with any upgrades. Also, when I tested the creation of a custom email from the admin panel as described above I could not find where it is stored and gave up in short order so maybe I will yet discover where they are (right now I suspect in the db?).

    Nevertheless, it was much easier to do a search and replace through the files than use the admin panel and having the static blocks means that if I need to change the contact phone number it’s just once in the CMS. Note that the same search and replace does not work in all the templates as some have a “<div style=…” while other have a “<style body, td”

    By the way I made blocks for style, logo, contact, and signature. Again, I got the block idea from the mag forum and hope someone else here might find it helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.

Tell us about your project

Drop us a line. We'd love to know more about your project.