The group had a conversation in slack about the email wrapper template. This discussion was picked up again in the call. The main point was whether it would be useful if the template allows for multiple regions, similar to page.html.twig.

  • Easy Email has an inbox preview feature. The inbox preview is some text displayed together with the subject in some webmail clients (e.g., gmail). Sometimes the index preview feature breaks when people customize their Symfony Mailer Lite wrapper template by inadvertently adding branding related markup in front of the body (which also contains the easy email inbox summary). This problem could be mitigated by defined regions.
  • There is a contrib module which adds a View in Browser link to outgoing emails. Currently it is necessary to concatenate strings in hook_mail_alter() to make that work. Other sites might have a requirement to add fine print to the bottom of every message. This should ideally be solvable by injecting a render array into a region - or a similar mechanism.

The latest commits in #3539651: Introduce email plugins reintroduced the ability to provide the body at the call site. This idea was discussed before (#3564527: [meeting] 2025-12-17 core mailer dev meeting). There is still uncertainty whether this could have a negative effect on translatability. It is fine if the API is flexible enough to make this work. For core, the focus should lie on consistency. The primary way of building email should be twig templates.

Some work went into refactoring the email call sites in core to make them swappable (#3125013: Refactor update.fetch.inc into a MailHandler, #3539178: Extract _user_mail_notify() into a user NotificationHandler). Those issues are finished, they might get committed in the near future. With those issues out of the way, it will be easy to provide replacements for all core email in the experimental mailer module. These would be activated if the mailer module is enabled.

What’s next:

Comments

znerol created an issue. See original summary.

znerol’s picture

Issue summary: View changes
znerol’s picture

Issue summary: View changes
znerol’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

znerol’s picture

Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.