Get Free Audit

How to Configure Email Templates in Magento

Feb 12, 2018

11878 Andrey Litvin

How to Configure Email Templates in Magento

Customizing Magento involves many various things, but when it comes to email templates, the area usually gets neglected. That’s why today’s article is about email templates, the ways to create them, use variables and add the images as well as links.

Customization of transactional email templates

Create and assign custom transactional email templates

In order to create an email template, you need to go to the System->Transactional Emails.

transactional-emails

Then you need to add a new template by clicking the ‘Add New Template’ button 

migration to magento 2

Magento 2 Migration

Take your online store to the next level with BelVG Magento 2 Migration

Visit the page

Fill in the forms (for example, as it is in the contact form).

forms

Assign it in the System/Configuration, and then Sales/Sales Emails as it’s shown in the picture.

sales-emails

Use of template variables available in each email {store, var, …} and how to access properties of variable objects (for example var order.getCustomer.getName)

Actually, there are many variables that can be used in the email templates. The essentials are considered to be var, store, inlinecss, template.

Igor Dragun

Partner With Us

Let's discuss how to grow your business. Get a Free Quote.
Talk to Igor

Besides, there’re conditions as in PHP: {if} {/if}

For example, as it’s used in the template (/app/locale/en_US/template/email/password_or_email_changed.html):


Here we also can see how inlinecss is added to the email template:


NOTE: I marked the condition with bold type and showed the way how to add inline style in the email template.

In order to use variables in email templates, you need to use the ‘get’ PHP method:


For example, as it’s used in the template (/app/locale/en_US/template/email/html/footer.html):

Igor Dragun
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Igor


magento custom development

Magento Custom Development

Take your online store to the next level with BelVG Magento Custom Development

Visit the page

Link to custom images from transactional email templates

In order to include a custom image in the email template, you need to put the following tags:

  • When adding an image from template: {{skin url='images/imagename.jpg'}}
    edit-email-template
  • When adding an image from media: {{media url='images/imagename.jpg'}}

Create links to store pages in transactional email templates

In order to create a link to store pages in email templates, you need to use the following construction: {{store url=""}}

For example, like that

email-template-example
or like in the template (app/locale/en_US/template/email/html/header.html):


In case you need to create a link to the category page or other pages, use this construction:


magento webdesign

Magento Webdesign

Take your online store to the next level with BelVG Magento Webdesign

Visit the page
Igor Dragun
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Igor

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *