-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[TwigBridge] Render email once #39733
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
3917970
to
b0f4188
Compare
@carsonbot do you know who could review this? |
@carsonbot please find me a reviewer |
@pupaxxo could maybe review this PR? |
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.
Thank you
I think that this PR is not a feature, but a bug fix and that it should be merged into the 4.4 branch. My problem is that when my app sends a templated email to the async transport, it is rerenderd in an HTTP context and stored with the URLs pointing to the correct hostname, but when the message is consumed from the console I know that it can be fixed by setting the |
This issue is addressed by another of my PR 😛 #39688 |
b0f4188
to
186ea59
Compare
rebased on 4.4 |
I though this PR would be merged before releasing version 4.4.20. Can I help to get it merged soon? Thanks |
Thank you Jérémy. |
This has caused a b/c break :-( details incoming... |
Serialization of 'Closure' is not allowed #40445 |
When
\Symfony\Component\Mailer\Mailer
send an email via the Bus (async) it dispatches anMessageEvent
, then the consumer call the\Symfony\Component\Mailer\Transport\AbstractTransport::send
method which also dispatches anMessageEvent
.This event is listened by
\Symfony\Bridge\Twig\Mime\BodyRenderer::render
which rendered twice an email.I'm not sure why the event is send twice, and if we could safely remove one of them (or maybe deprecating the
MessageEvent
, in favor ofSendMessageEvent
+AsyncMessageEvent
)This PR store a flag in the Message to avoid rendering it twice.