@@ -1023,6 +1023,48 @@ you have a transport called ``async``, you can route the message there:
1023
1023
Thanks to this, instead of being delivered immediately, messages will be sent to
1024
1024
the transport to be handled later (see :ref: `messenger-worker `).
1025
1025
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
+
1026
1068
Adding Tags and Metadata to Emails
1027
1069
----------------------------------
1028
1070
0 commit comments