Skip to content

Commit 38be5a8

Browse files
committed
minor symfony#17623 [Mailer] Add a way to change the Bus transport dynamically (alamirault)
This PR was merged into the 6.2 branch. Discussion ---------- [Mailer] Add a way to change the Bus transport dynamically Try complete symfony#17127 I took example on `X-Transport` header https://symfony.com/doc/current/mailer.html#multiple-email-transports Commits ------- 5c1771f [Mailer] Add a way to change the Bus transport dynamically
2 parents 04dcb31 + 5c1771f commit 38be5a8

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
@@ -1342,6 +1342,18 @@ disable asynchronous delivery.
13421342
The :method:`Symfony\\Component\\Mailer\\Transport\\Smtp\\SmtpTransport::stop`
13431343
method was made public in Symfony 6.1.
13441344

1345+
Bus transport can also be selected by
1346+
adding an ``X-Bus-Transport`` header (which will remove automatically from
1347+
the final message)::
1348+
1349+
// Use the bus transport "app.another_bus":
1350+
$email->getHeaders()->addTextHeader('X-Bus-Transport', 'app.another_bus');
1351+
$mailer->send($email);
1352+
1353+
.. versionadded:: 6.2
1354+
1355+
The ``X-Bus-Transport`` header support was introduced in Symfony 6.2.
1356+
13451357
Adding Tags and Metadata to Emails
13461358
----------------------------------
13471359

0 commit comments

Comments
 (0)