Skip to content

Commit 0fb20d7

Browse files
committed
[Mailer] Configuration of the message_bus to use
1 parent 5ff7cc7 commit 0fb20d7

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

mailer.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,48 @@ you have a transport called ``async``, you can route the message there:
10231023
Thanks to this, instead of being delivered immediately, messages will be sent to
10241024
the transport to be handled later (see :ref:`messenger-worker`).
10251025

1026+
You can configure which bus is used to dispatch the message using the ``message_bus`` option.
1027+
You can also set this to ``false`` to call the Mailer transport directly and
1028+
disable asynchronous delivery.
1029+
1030+
.. configuration-block::
1031+
1032+
.. code-block:: yaml
1033+
1034+
# config/packages/mailer.yaml
1035+
framework:
1036+
mailer:
1037+
message_bus: app.another_bus
1038+
1039+
.. code-block:: xml
1040+
1041+
<!-- config/packages/messenger.xml -->
1042+
<?xml version="1.0" encoding="UTF-8" ?>
1043+
<container xmlns="http://symfony.com/schema/dic/services"
1044+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1045+
xmlns:framework="http://symfony.com/schema/dic/symfony"
1046+
xsi:schemaLocation="http://symfony.com/schema/dic/services
1047+
https://symfony.com/schema/dic/services/services-1.0.xsd
1048+
http://symfony.com/schema/dic/symfony
1049+
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
1050+
1051+
<framework:config>
1052+
<framework:mailer
1053+
message_bus="app.another_bus"
1054+
>
1055+
</framework:mailer>
1056+
</framework:config>
1057+
</container>
1058+
1059+
.. code-block:: php
1060+
1061+
// config/packages/mailer.php
1062+
$container->loadFromExtension('framework', [
1063+
'mailer' => [
1064+
'message_bus' => 'app.another_bus',
1065+
],
1066+
]);
1067+
10261068
Adding Tags and Metadata to Emails
10271069
----------------------------------
10281070

0 commit comments

Comments
 (0)