Symfony mailer transports are unable to to dispatch events

Created on 31 January 2024, 10 months ago
Updated 25 February 2024, 9 months ago

Problem/Motivation

Due to the way that the transport is loaded through the configuration - there is no mechanism at present for the Symfony events to be dispatched (the event dispatcher is not passed through when setting up the transport / factory) resulting in us being unable to subscribe to the MessageEvent, SentMessageEvent, FailedMessageEvent that would otherwise be raised.

This is counter intuitive vs the mailer service definition itself, which then does pass the event dispatcher, however it'll only raise queuing events when a message bus is passed in (optional dependency in current definition).

Ultimately this is a developer experience problem, as this doesn't alter the ability to send emails directly - but more the ability to respond to events connected to them

Proposed resolution

Change the way that the factory generates the transports so that we are indeed passing the event dispatcher when creating our respective Transports service definition.

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom dan.munn

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024