@@ -1174,6 +1174,52 @@ you have a transport called ``async``, you can route the message there:
11741174 Thanks to this, instead of being delivered immediately, messages will be sent to
11751175the transport to be handled later (see :ref: `messenger-worker `).
11761176
1177+ You can configure which bus is used to dispatch the message using the ``message_bus `` option.
1178+ You can also set this to ``false `` to call the Mailer transport directly and
1179+ disable asynchronous delivery.
1180+
1181+ .. configuration-block ::
1182+
1183+ .. code-block :: yaml
1184+
1185+ # config/packages/mailer.yaml
1186+ framework :
1187+ mailer :
1188+ message_bus : app.another_bus
1189+
1190+ .. code-block :: xml
1191+
1192+ <!-- config/packages/messenger.xml -->
1193+ <?xml version =" 1.0" encoding =" UTF-8" ?>
1194+ <container xmlns =" http://symfony.com/schema/dic/services"
1195+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
1196+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
1197+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
1198+ https://symfony.com/schema/dic/services/services-1.0.xsd
1199+ http://symfony.com/schema/dic/symfony
1200+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
1201+
1202+ <framework : config >
1203+ <framework : mailer
1204+ message_bus =" app.another_bus"
1205+ >
1206+ </framework : mailer >
1207+ </framework : config >
1208+ </container >
1209+
1210+ .. code-block :: php
1211+
1212+ // config/packages/mailer.php
1213+ $container->loadFromExtension('framework', [
1214+ 'mailer' => [
1215+ 'message_bus' => 'app.another_bus',
1216+ ],
1217+ ]);
1218+
1219+ .. versionadded :: 5.1
1220+
1221+ The ``message_bus `` option was introduced in Symfony 5.1.
1222+
11771223Adding Tags and Metadata to Emails
11781224----------------------------------
11791225
0 commit comments