yiisoft/yii2-symfonymailer

Expose symfony mailer events

machour opened this issue · 2 comments

What steps will reproduce the problem?

Currently there is no way to hook on the Mailer Events

What's expected?

I expect to be able to set a Yii event for this, and be able to interact with Symfony Mailer prior to message sending, to inline CSS for example.

What do you get instead?

Nothing, and that's blocking me from switching from Swift Mailer.

Let's implement this after #27 gets finally merged.

#27 was merged btw!

To implement this in a generic way we must implement EventDispatcherInterface and route the message to the Yii event system. I'd argue for making this a separate adapter library. It has uses for hooking up any Symfony library with the Yii event system.

Next step would be to pass this event dispatcher to the call to Transport::getDefaultFactories().

Have implemented this as a proof of concept; it is fully untested though. Please test if it works and provide feedback in #52!