8000 [Mailer] Added the ability to configure mailer component to send messages without bus by voodooism · Pull Request #34646 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Mailer] Added the ability to configure mailer component to send messages without bus #34646

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

Closed
wants to merge 1 commit into from

Conversation

voodooism
Copy link
Contributor
@voodooism voodooism commented Nov 27, 2019
Q A
Branch? 4.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets no
License MIT
Doc PR no

There is no way to configure the mailer component without a bus.
If I have messenger.default_bus provided by symfony/messenger in my app - mailer automatically works via bus. Because it is injected as an argument.
I want to use the mailer component without a bus, even if I have the bus in the project.
Is there any other way to set MessageBusInterface as null directly?

I propose to add a configuration to the mailer component. Something like that:

framework:
    mailer:
        use_bus: false # default value - true.

P.s. I'm doing a pull request first time in the Symfony repository, so let me know if something is wrong. Any feedback

@ogizanagi
Copy link
Contributor
ogizanagi commented Nov 27, 2019

Well, I literally opened #34648 right after yours @voodooism. I'm sorry, I should have searched for issues & open the PR yesterday. 😕
I suggest a slightly different approach in it: allow to configure the bus to use, or disable it by setting a new mailer.message_bus option to false.

@nicolas-grekas nicolas-grekas changed the title [Mailer] Added the ability to configure mailer component to send mess… [Mailer] Added the ability to configure mailer component to send messages without bus Nov 27, 2019
@nicolas-grekas nicolas-grekas added this to the next milestone Nov 27, 2019
@fabpot
Copy link
Member
fabpot commented Nov 30, 2019

Thanks for the PR @voodooism . I'm going to merge the PR opened by @ogizanagi instead as it is a bit more flexible.

@fabpot fabpot closed this Nov 30, 2019
@voodooism
Copy link
Contributor Author

@fabpot Can you explain to me at which version to expect changes? Will this feature be merged with a 4.3/4.4 Symfony version? Or it'll appear only in Symfony 5 version?

@xabbuh
Copy link
Member
xabbuh commented Dec 4, 2019

New features are only merged in the development branch (usually master) which is the base of the next minor release (i.e. new features merged now will first be part of Symfony 5.1 released in May 2020).

@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 4, 2020
@Zemke
Copy link
Zemke commented Jun 16, 2022

It took me some hours to get here realizing that my email wasn’t sent just because I wasn’t running the message consumer. Alternatively the TransportInterface could be injected and used directly. Well, now I better empty the message queue.

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.

7 participants
0