Repository navigation
Upgrade to Symfony 4.4 - #1144
Conversation
4.4 Upgrade Tweaks
| # TODO this does not seem to work | ||
| recipients: ['%env(APP_DEV_EMAIL_RECIPIENT)%'] |
There was a problem hiding this comment.
Anyone has a clue here why this would fail? I have the env var set in .env.local, and yet emails seem to go wherever they want.
There was a problem hiding this comment.
This goes far beyond my understanding of the Mailer component, but...
With Mailtrap set up on SMTP, inside the SmtpTransport class when I dump the recipients I get the right address (the one from this config), but when I dump the message stream the body it builds has the original email address added to the email. That's about as far as I can get before I'm over my head.
There was a problem hiding this comment.
Emails have 2 different concepts: the recipients in the mime messages (the To and Cc headers) and the recipients in the SMTP protocol (which is where the email gets routed by SMTP).
When using this recipients feature, the Mailer component overrides things only at the level of the SMTP envelope, not in the mime headers. So you will still see the original recipients in the headers in your email client, even though emails should be delivered to your own mailbox.
There was a problem hiding this comment.
Ah that may explain the problem I saw then, as I tested it with a foo@ alias which lands in my inbox anyway.. Will test overriding with an other domain entirely.
There was a problem hiding this comment.
you could look at the Delivered-To headers in the received email (which is how these SMTP-level features are surfaced)
|
Thanks for the review @stof - fixed everything and the couple other TODOs I had left. Happy to get another round of review now I think it's all done. Only problem left that I am aware of is the comment I wrote above about mailer.yaml. |
Co-authored-by: Michael Babker <michael.babker@gmail.com>
Not quite finished yet.