Using Email Layouts

Last edit: 


This guide will help you provide a layout for your email notifications.


As the concept of an email layout is the same as the concept of a layout for pages, you should understand the concepts of layouts and notifications, and should have created an email notification before.


Using email layouts is a two-step process:

  1. Create email layout file
  2. Edit email layout file

Step 1: Create email layout file

The default layout file for all emails should be located in the views/layouts directory. Create a file named mailer.html.liquid.

Step 2: Edit email layout file

The content of an email layout is slightly different from the content of a layout for pages, because it needs to be marked as an email layout.

Add the following to your email layout file mailer.html.liquid:


  {{ content_for_layout }}


Where {{ content_for_layout }} injects the body defined in the email notification into the layout. Without it, you would be sending a layout without actual content.

Next steps

Congratulations! You know how to use email layouts. Now you can learn about creating an SMS notification.


We are always happy to help with any questions you may have. Check out our Help page, or contact us.