Skip to content

Developers · Notifications and Email

Using Email Layouts

Last updated 1 November 2026

This document shows you how to provide a layout for your Email Notifications.

Prerequisites

To follow this tutorial, it is necessary to have a good grasp of layouts and notifications and the ability to create an email notification since email layouts are similar to page layouts.

Steps

Using email layouts is a three-step process:

  • Step 1: Create an email layout file
  • Step 2: Edit the email layout file
  • Step 3: Use the layout in an email

Step 1: Create an email layout file

The default layout file for all emails should be located in the directory. Create a file named .

Step 2: Edit the email layout file

Add the following to your email layout file :

Header

{{ content_for_layout }}

Footer

Where injects the body defined in the Email Notification into the layout. Without this part, you would be sending a layout without actual content.

Step 3: Use the layout in an email

To use the newly created layout in your Email Notification, set :

layout: mailer

Next Steps

Congratulations! You know how to use email layouts. Now you can learn about including attachments: Adding Attachments to an Email Notification