How to Use Multiple Footers for Email Templates

emailemail-templates

Is it possible to use multiple footers for the Transactional Emails?

So I want to use a specific footer for a new order email, and an other footer for the shipment email.

I currently load the footer with this line: {{template config_path="design/email/footer"}}

How can I load a specific template in the transactional email?

Best Answer

There are two things to first understand about transactional emails:

  1. By default the templates are in app/locale/en_US/template/email where en_US is the locale code configured for the store.
  2. They can be loaded into the database and edited using an editor within the browser. If an override is done that way, they are no longer loaded from the filesystem.

So first decide, if you want to keep them loading from the file system (and thus be able to version them) or from the database (so the merchant can easily edit the layout).

The footer and header are special:

The template is configured via the system configuration System > Configuration > [General:Design] > Transactional Emails. By default it's set to "Default from locale" which refers to the file app/locale/en_US/template/email/html/footer.html.

To change the footer, you need to add a new template that is then stored in the database. Go to System > Transactional Emails. You'll get a screen that has a top section to load an already defined template as base and it's probably wise to load the default:

Load footer email

However, Magento assumes that there's a shared footer (and shared header) for all emails, so while you can change it, you cannot change it per email.

So, in this case, your best bet is to change the order_new.html template in app/code/locale/en_US/template/email/sales. Remove the {{template config_path="design/email/footer"}} and replace it with the HTML you want. This is the easiest way to override a footer for a specific template.

If you have different requirements, expand your question and we'll try to help you.

Related Topic