Time for action – changing the text inside transactional e-mails

To change the text inside a transactional e-mail, you will have to make a new e-mail template inside the Magento admin. In the following steps we will show how to do that, with the new order e-mail for guests as an example. What this e-mail looks like by default can be seen in the screenshot shown earlier. As a simple example, we will be changing the text "Thank you again for your business" to "Hope to see you again soon".

  1. Open Magento's transactional e-mail management and add a new template.

    Transactional e-mails can be added by going to System | Transactional Emails in Magento's admin. Once there, click on the Add New Template button, which is found in the top-right corner of the screen, as can be seen in the following screenshot:

    Time for action – changing the text inside transactional e-mails
  2. Choose the proper default settings to load.

    A fairly big, empty form should be shown now. Luckily, you do not have to input all the required settings for the new order e-mail manually. In the drop-down menu called Template, select the New Order for Guest option and click on the Load Template button, as shown in the following screenshot:

    Time for action – changing the text inside transactional e-mails

    Now the form will be filled with the default settings for the new order e-mail that is sent to customers who are not logged in when they order.


  3. Make the desired changes and save.

    The Template Name field reflects the name you want to give this template to use internally inside the Magento admin. Your customers will not see this name; the name you give the template here is purely to make it easy for you to find. We recommend something like Store Name – Language – Type of email. In our current example, we have used Demo Store – English – New Order for Guests.

    The Template Subject field is the subject line the e-mail will have. Inside this input field, you will see strange characters such as {{ and }}. For the purposes of this book, we recommend not touching anything that starts with {{ and ends with }}. These are bits of content that will be replaced by Magento when the e-mail is actually sent, and are called variables. For example, {{var order.increment_id}} will be replaced by Magento with the unique order code for a customer's specific order. Just leaving them as they are is a good idea; editing everything else in the subject line is safe.

    The Template Content input area is what we are currently interested in. In this area, you will see a mix of HTML, regular text, and variables. We recommend to leave everything that is enclosed between < and >, or {{ and }} intact. The former are HTML tags and the latter are Magento's variables.

    For the current example, scroll down inside the Template Content field until you see the text "Thank you again for your business" and replace it with "Hope to see you again soon", as shown in the following screenshot. After that, click on the Save Template button:

    Time for action – changing the text inside transactional e-mails
  4. Configure Magento to use the e-mail template.

    Just making the transactional e-mail inside the Transactional Emails section in System does not actually have any effect yet. In order for Magento to actually use the template, we have to tell Magento to use it through the configuration section, and specifically the configuration of sales order e-mails.

    Go to System | Configuration | Sales Emails, found in the left-hand menu of the configuration section of the Magento admin. There, open the Order section. In the New Order Confirmation Template for Guest drop-down menu, select the template we just made, as shown in the following screenshot:

    Time for action – changing the text inside transactional e-mails

    After selecting our own template (note that you will see the template name you entered earlier inside the drop-down menu in this configuration section), click on the Save Config button.

You are now done! You may need to refresh Magento's caches; refer to Chapter 11, Maintaining and Administrating Your Store, for more information about that.

What just happened?

Changing the contents, or layout if you are confident enough, of transactional e-mails always involves two steps: creating the transactional e-mail in System | Transactional Emails and after that configuring Magento to actually use the newly-made transactional e-mail. In Chapter 6, Customer Relationships, we already showed where most configuration settings relating to customer account e-mails can be found. In the preceding discussion, we mentioned going to System | Configuration | Sales Emails, where you will find the configuration settings for the various order-related e-mails Magento sends out. Other often used configuration sections for transactional e-mails are System | Configuration | Contacts, System | Configuration | Newsletter, and System | Configuration | Wishlist. A practical way of tackling transactional mails is simply testing your shop thoroughly. Note every e-mail that is not to your liking and determine which template you should add to the Emails section to solve that.

Note

It is very important to understand the difference between a guest order and an order by a registered customer. Please refer back to Chapter 6, Customer Relationships, for more information about this difference if necessary. Magento sends out different order, invoice, and shipment e-mails to guests and logged in customers!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset