Email template master page

Master page is useful for sharing common layout and content across multiple email templates. Use master page for CSS, header and footer text, company logo not only improves the consistency in the email presentation but also reduces the maintenance effort of the templates.

A master page typically has the following elements. The @RenderBody() is required and it is replaced with the email content when the template is rendered.

<html> <head> <style> <!-- Global CSS --> </style> </head> <body> <p> <!-- Header text --> </p> <div> @RenderBody() </div> <p> <!-- Footer and logo --> </p> </body> </html>

How to create a master page

  1. Navigate to the /comms/templates URL to create a new page.

  2. Specify the name of the template, do not use space in the name.

  3. Select the Razor template type and Master page type.

  4. Complete the body html.

  5. Save the template.

How to use a master page

  1. Select the template content page.

  2. Add the Layout = "<master page name>.cshtml" inside the @{ } block, as indicated below. Add the @{ } block if it doesn’t exist in the content page.

Please refer to this link for more detail about layout and content pages: https://learn.microsoft.com/en-us/aspnet/core/mvc/views/layout?view=aspnetcore-7.0