Skip to content

There is no way configure mailer component without using message bus #34633

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
voodooism opened this issue Nov 26, 2019 · 3 comments
Closed

There is no way configure mailer component without using message bus #34633

voodooism opened this issue Nov 26, 2019 · 3 comments

Comments

@voodooism
Copy link
Contributor

Symfony version(s) affected: 4.3.8

Description

There is no way to configure the mailer component without a bus. If I have the messenger component in my app mailer automatically works via bus. But I want to send a message instantly without using a message bus
https://github.com/symfony/mailer/blob/4.3/Mailer.php#L29

Possible Solution
Maybe it is a good idea to add the ability to configure this?

@mhujer
Copy link
Contributor

mhujer commented Nov 26, 2019

@voodooism looking at the linked code I can see that the message bus is optional and the messages is sent immediately if no message bus is provided.

https://github.com/symfony/mailer/blob/a2e19255ce8de3a9c4e5228fde33ca9390af787c/Mailer.php#L35-L41

@voodooism
Copy link
Contributor Author

voodooism commented Nov 26, 2019

@voodooism looking at the linked code I can see that the message bus is optional and the messages is sent immediately if no message bus is provided.

https://github.com/symfony/mailer/blob/a2e19255ce8de3a9c4e5228fde33ca9390af787c/Mailer.php#L35-L41

@mhujer Yes, you are absolutely right. But, I have messenger.default_bus provided by symfony/messenger. And this 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 way to set MessageBusInterface as null directly?

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

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

@voodooism
Copy link
Contributor Author

I had added the pull request with my propose. I did pull request first time in the Symfony repository, so let me know if something is wrong. Any feedback

@fabpot fabpot closed this as completed Nov 30, 2019
fabpot added a commit that referenced this issue Nov 30, 2019
… to use (ogizanagi)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[Mailer] Allow to configure or disable the message bus to use

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | #34633 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | todo

A new `mailer.message_bus` option allowing to choose the message bus to use instead of using the default one.
Also allows to set it to `false` so no message bus is used and the transport will be called directly.

Commits
-------

42fd0cf [Mailer] Allow to configure or disable the message bus to use
fabpot added a commit that referenced this issue Dec 11, 2022
…ble the message bus to use (jschaedl, fabpot)

This PR was merged into the 6.3 branch.

Discussion
----------

[FrameworkBundle][Notifier] Allow to configure or disable the message bus to use

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | tbd <!-- required for new features -->

For the mailer integration there is already a possibility to disable or configure the `message_bus` to use. See: #34633 and #34648

This PR introduces a similar config option `notifier.message_bus` for the notifier integration.

Things done:

- [x] Add a config option `notifier.message_bus` for the notifier configuration
- [x] Adjust FrameworkExtension considering the new `message_bus` config option
- [x] Add tests for the new config option

Commits
-------

fc7aaa6 Fix logic and tests
215e802 Allow to configure or disable the message bus to use
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this issue Dec 11, 2022
…ble the message bus to use (jschaedl, fabpot)

This PR was merged into the 6.3 branch.

Discussion
----------

[FrameworkBundle][Notifier] Allow to configure or disable the message bus to use

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | tbd <!-- required for new features -->

For the mailer integration there is already a possibility to disable or configure the `message_bus` to use. See: symfony/symfony#34633 and symfony/symfony#34648

This PR introduces a similar config option `notifier.message_bus` for the notifier integration.

Things done:

- [x] Add a config option `notifier.message_bus` for the notifier configuration
- [x] Adjust FrameworkExtension considering the new `message_bus` config option
- [x] Add tests for the new config option

Commits
-------

fc7aaa6123 Fix logic and tests
215e802741 Allow to configure or disable the message bus to use
symfony-splitter pushed a commit to symfony/framework-bundle that referenced this issue Jul 28, 2023
…ble the message bus to use (jschaedl, fabpot)

This PR was merged into the 6.3 branch.

Discussion
----------

[FrameworkBundle][Notifier] Allow to configure or disable the message bus to use

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | tbd <!-- required for new features -->

For the mailer integration there is already a possibility to disable or configure the `message_bus` to use. See: symfony/symfony#34633 and symfony/symfony#34648

This PR introduces a similar config option `notifier.message_bus` for the notifier integration.

Things done:

- [x] Add a config option `notifier.message_bus` for the notifier configuration
- [x] Adjust FrameworkExtension considering the new `message_bus` config option
- [x] Add tests for the new config option

Commits
-------

fc7aaa6123 Fix logic and tests
215e802741 Allow to configure or disable the message bus to use
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants