Create email CMS blocks

Edit on GitHub

You can manage the content of emails you send to customers by editing email templates via CMS Blocks.

There is a number of default emails that are automatically sent on different occasions, like customer registration or order shipment. You can change the default emails by editing their email templates via respective CMS blocks. For the full list of the emails with their email CMS blocks, see Default email templates.

If a developer introduced a new email for your project, you need to create an email block for it. Blocks for the default email templates are already created, and you can edit them as regular blocks.

Prerequisites

Review the reference information before you start or look up the necessary information as you go through the process.

Create an email CMS block

  1. Go to Content > Blocks.
  2. On the Overview of CMS Blocks page, select Create block.
  3. On the Create new CMS block page, select a TEMPLATE.
  4. Enter a NAME.
  5. Click Save. This opens the Edit CMS Block Glossary page with a success message displayed.
  6. For CONTENT, add the content of the email for the needed locales.
Content items in email blocks

Content items are not rendered in emails.

  1. Click Save. This refreshes the page with a success message displayed.

  2. Pass the name of the created email CMS block to your development team to add to the respective Twig email template.

Activating email blocks

You don’t need to activate the email CMS block, as the deactivated status of the email CMS block does not prevent emails from being sent.

Tips and tricks

  • Add a glossary key to the email block. When the email is sent, the key is replaced with the translation you defined for the locale selected by the customer. To learn how to add translations, see Managing glossary.

  • Add variables to the email CMS block to replace them with customer and order specific details. When the email is sent, the variables are replaced with the actual details. For example, add firstName, and it is replaced with the name of the customer the email is sent to. A developer can provide a full list of variables and create new ones.

Reference information: Create an email CMS block

ATTRIBUTE DESCRIPTION: EMAIL CMS BLOCK
STORE RELATION Irrelevant.
TEMPLATE Defines the layout of the Email CMS Block. A developer can create more templates.
NAME The name should correspond to the name defined in the email template the block will be assigned to.
VALID FROM and VALID TO Irrelevant.
PRODUCTS Irrelevant.