Events/callbacks for new mailer service

Created on 18 June 2025, 18 days ago

Problem/Motivation

Follow up from Create new mailer service based on symfony Active . As we build on the Symfony mailer service we need extra events and callbacks:

  1. We need to allow code to react to each of the 4 phases in the email processing pipeline.
  2. We have extended the Email class, so would like to pass the new class on the event.
  3. Code needs to react only to specific emails. Module mailer plug-ins/services react only to the emails that they build. Configuration email plug-ins ("adjusters") react only to emails that they are configured on.

Proposed resolution

Modules have two options for how to process mails.

  1. Handle an event (there is one event for each phase).
  2. Write an email processor class implementing EmailProcessorInterface, which has a function for each phase. This class can be registered on specific mails using $email->addProcessor().

All the events and functions have a single argument/member of type EmailInterface.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

11.0 🔥

Component

mail system

Created by

🇬🇧United Kingdom adamps

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024