Skip to content

[Mailer] Add more information about sending email async #17065

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

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Jul 27, 2022

The example only works as of 6.2 thanks to symfony/symfony#47075

I've written this PR because we keep having issues like symfony/symfony#44439.
So, documenting a bit more how it works internally might help people understand what to do.


Thanks to this, instead of being delivered immediately, messages will be sent to
the transport to be handled later (see :ref:`messenger-worker`).
.. versionadded:: 6.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imho this should be a warning, otherwise it gets removed in Symfony 7 docs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this removed in 7.0 is a good thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done then

@fabpot fabpot force-pushed the mailer-async-impr branch from a39cd4f to 4fbbc16 Compare July 27, 2022 09:11
fabpot added a commit to symfony/symfony that referenced this pull request Jul 27, 2022
…e (fabpot)

This PR was merged into the 6.2 branch.

Discussion
----------

[Mime] Change the way we avoid rendering an email twice

| Q             | A
| ------------- | ---
| Branch?       | 6.2
| Bug fix?      | yes-ish
| New feature?  | yes-ish <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#17065

Trying to kill several birds with one stone here.

I was not very happy with the way we ensured that emails were not renderer more than once.
This solution seems easier and allows for people to render an email **before** sending it to Messenger (important when you have Doctrine entities in the context for instance) as documented in the related doc PR.

Commits
-------

cc3b871 [Mime] Change the way we avoid rendering an email twice
@fabpot
Copy link
Member Author

fabpot commented Jul 27, 2022

Related PR has been merged now.

@carsonbot carsonbot changed the title Add more information about sending email async [Mailer] Add more information about sending email async Jul 27, 2022
@javiereguiluz
Copy link
Member

Thank you Fabien.

@javiereguiluz javiereguiluz merged commit b15763c into symfony:6.2 Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants