How to Customize Magento 2 Email Templates

Magento 2 lets an administrator create custom transactional email templates without editing the shipped template files. The safe workflow is to load the relevant default template, make a named copy, use supported variables, assign it to the correct configuration scope and test the actual email flow before production use.

Create a custom template in Admin

Go to Marketing > Communications > Email Templates and choose Add New Template. Select the system template you want to customize and load it. Give the custom template a clear name, review the subject and content, and save the new template instead of overwriting shipped files.

Use supported variables instead of guessed placeholders

Use Insert Variable and the variables exposed by the selected template. Preserve existing template directives unless you understand what supplies them. A placeholder copied from another message type is not automatically available in the current email context.

  • Keep order, customer and store variables tied to the template type that provides them.
  • Avoid inserting arbitrary PHP or relying on variables that are not offered by the template context.
  • Keep CSS/email markup compatible with the email clients your customers use; storefront CSS is not automatically available inside email clients.

Preview, then assign the template

Use the template preview as a visual check, but do not treat preview as proof that runtime variables or attachments work. To use the template, open Stores > Settings > Configuration, go to the configuration section that owns the message (for example Sales > Sales Emails for order-related messages), choose the correct website/store-view scope, clear Use system value where required, select the custom template and save the configuration.

Header and footer configuration is separate

Email header and footer templates can be assigned through Content > Design > Configuration for the relevant store view. This is different from assigning a specific order, invoice, shipment, account or password email template.

Test the real message flow

After saving configuration, clear only the caches required by the change if Magento reports stale configuration. Trigger the email in a safe test context and check the subject, sender identity, links, store-view content, variables, totals, responsive layout and fallback text. Repeat for each store view that uses a different template.

  • Missing variable output: confirm the variable exists for that email type.
  • Wrong template sent: verify website/store-view scope and the owning configuration field.
  • Styling differs from preview: test the received message in real email clients.
  • Changes appear stale: verify saved scope and relevant Magento cache state before editing again.

Reference

Adobe Commerce documents the same Admin workflow for creating email templates and using the available variables.


Need help with transactional email behavior?

If the issue involves the data supplied to templates, store-view configuration or custom Magento logic rather than copy alone, share the affected message type and expected output.