From 2d924e8363900bf0a2b0f6be2604696472e6db9f Mon Sep 17 00:00:00 2001 From: Thibault RICHARD Date: Sun, 28 Feb 2021 23:25:47 +0100 Subject: [PATCH] [Mailer] Configuration of the message_bus to use --- mailer.rst | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/mailer.rst b/mailer.rst index 9c9c1451add..39f2cb42081 100644 --- a/mailer.rst +++ b/mailer.rst @@ -1094,6 +1094,52 @@ you have a transport called ``async``, you can route the message there: Thanks to this, instead of being delivered immediately, messages will be sent to the transport to be handled later (see :ref:`messenger-worker`). +You can configure which bus is used to dispatch the message using the ``message_bus`` option. +You can also set this to ``false`` to call the Mailer transport directly and +disable asynchronous delivery. + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/mailer.yaml + framework: + mailer: + message_bus: app.another_bus + + .. code-block:: xml + + + + + + + + + + + + .. code-block:: php + + // config/packages/mailer.php + $container->loadFromExtension('framework', [ + 'mailer' => [ + 'message_bus' => 'app.another_bus', + ], + ]); + +.. versionadded:: 5.1 + + The `message_bus` option was introduced in Symfony 5.1. + Adding Tags and Metadata to Emails ----------------------------------