Skip to content

Commit 5c1771f

Browse files
committed
[Mailer] Add a way to change the Bus transport dynamically
1 parent 341aacf commit 5c1771f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mailer.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,18 @@ disable asynchronous delivery.
13331333
The :method:`Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport::stop`
13341334
method was made public in Symfony 6.1.
13351335

1336+
Bus transport can also be selected by
1337+
adding an ``X-Bus-Transport`` header (which will remove automatically from
1338+
the final message)::
1339+
1340+
// Use the bus transport "app.another_bus":
1341+
$email->getHeaders()->addTextHeader('X-Bus-Transport', 'app.another_bus');
1342+
$mailer->send($email);
1343+
1344+
.. versionadded:: 6.2
1345+
1346+
The ``X-Bus-Transport`` header support was introduced in Symfony 6.2.
1347+
13361348
Adding Tags and Metadata to Emails
13371349
----------------------------------
13381350

0 commit comments

Comments
 (0)