Skip to content

Commit 83a5db0

Browse files
[Mailer] Switching to new array-shape config format
Page: https://symfony.com/doc/7.4/mailer.html#multiple-email-transports
1 parent e8d514e commit 83a5db0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

mailer.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,12 +1678,16 @@ This can be configured by replacing the ``dsn`` configuration entry with a
16781678
use Symfony\Config\FrameworkConfig;
16791679
use function Symfony\Component\DependencyInjection\Loader\Configurator\env;
16801680
1681-
return static function (FrameworkConfig $framework): void {
1682-
$framework->mailer()
1683-
->transport('main', env('MAILER_DSN'))
1684-
->transport('alternative', env('MAILER_DSN_IMPORTANT'))
1685-
;
1686-
};
1681+
return App::config([
1682+
'framework' => [
1683+
'mailer' => [
1684+
'transports' => [
1685+
'main' => env('MAILER_DSN'),
1686+
'alternative' => env('MAILER_DSN_IMPORTANT'),
1687+
]
1688+
]
1689+
]
1690+
]);
16871691
16881692
By default the first transport is used. The other transports can be selected by
16891693
adding an ``X-Transport`` header (which Mailer will remove automatically from

0 commit comments

Comments
 (0)