Skip to content

How it works ​

The Email Template module is intended to style all emails sent from EE. To fully understand how it works under the hood and where potential errors might occur, see the step-by-step process below:

  • When you send an email with EE, such as from the Communicate tab, EE processes it using the Email parser.
  • When the email is sent via the EE Email parser, the Email Template module intercepts it using a hook
  • The module extracts the body, determines the email type, and applies the appropriate settings. It then creates two new variables: {subject} and {body}.
  • In the settings page, there is a field called "template", where you place your HTML template containing the {subject} and {body} variables.
  • The module parses the template, including any additional template tags and the {subject} variable.
  • After that, {body} is replaced with the actual body. The body itself is not parsed for template tags, so content from e.g. a contact form can never execute EE tags.
  • Once the template is fully processed, the module rebuilds the email with the new body before it is sent.
  • An email that contains {do_not_parse} is sent without the template, see Variables.
  • Tip: For better HTML formatting, use the Premail site to compile everything into a single HTML file.