Instead of just
including a block
into an email template, Magento makes it possible to load a hole tree of blocks or just in other words a layout.
Here a small post about the the layout
directive in Magento 2 email templates with source code examples
from Magento.
I would like to explain the css
and inlinecss
directives and the variable
template_styles
of Magento 2 email templates in this post.
There are two logical directives that can be used in Magento 2 email templates. The depend
and the
if
directives. I will explain both in this post.
The title is maybe a little bit confusing, better would be maybe child template directives. This post
explains how to include a child template in a Magento email template. Pretty popular examples are
Magento_Email::email/footer.html
and Magento_Email::email/header.html
.
It can be quite comfortable to use configuration values in Magento 2 email templates. Let us assume we change our store phone number in the configurations and it changes also in templates where we use sentences like: You can call us any time at .... I will show pretty fast in this post how to use the restricted list of configs in email templates and will explain ways to add your own configuration paths.
Magento 2 email templates are supposed to be translated sentence by sentence. This post shows how to use the translator directive.
This post tries to explain every possible way to use blocks in Magento 2 email templates.