Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle][Mailer] Add a way to configure some email headers from semantic configuration#36736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/mailer.ymlShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
4ff0a6b to438eb32Compare
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks :) Here are some things I spotted.
src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsdShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
a2851d7 to7d4cd2fComparesrc/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…rom semantic configuration
j-schumann commentedJun 24, 2020
I don't know if commenting here or opening a new issue is better, but this seems the place closest to the action: I implemented a custom EventSubscriber for the MessageEvent before (currently working in 5.1) but this fails and seems will fail with this PR too in combination with the messenger: Variant A) Then the transport will dispatch the MessageEvent:https://github.com/symfony/mailer/blob/master/Transport/AbstractTransport.php#L61 Everything works as planned. Variant B) The email is than wrapped into a SendEmailMessage which in turn is serialized which eventually calls Symfony\Component\Mime\Message::ensureValidity() which will fail because the message has no FROM header, as the listener could not set it before. -- I think this PR will fail in the same way: The listener cannot set the headers before the message is serialized (because of the mentioned cloning), thus there will be no From header and serialization will fail. Also the Listener cannot replace the previously set placeholder sender address because it uses For me the current behavior in 5.1 would qualify as a bug, as "Instead of calling ->from() every time you create a new email, you can create an event subscriber and listen to the MessageEvent event to set the same From email to all messages." like the documentation states is not working because in combination with the messenger the listener cannot modify the message. I can open a new bug report for this if it helps. Best regards, |
fabpot commentedJun 25, 2020
@j-schumann Thanks for the details report. Can you please open a new issue? As the PR here is merged, we won't be able to track your issue properly and it will get lost. |
Uh oh!
There was an error while loading.Please reload this page.
The configuration allows to set global
senderandrecipients, but for theenvelope.If you want to set some global headers, it was not possible (a default
fromheader for instance, of abcc).That's implemented in this PR.