diff --git a/mailer.rst b/mailer.rst index 229964ce30e..c4ad3e254a8 100644 --- a/mailer.rst +++ b/mailer.rst @@ -825,6 +825,8 @@ and it will select the appropriate certificate depending on the ``To`` option:: $firstEncryptedEmail = $encrypter->encrypt($firstEmail); $secondEncryptedEmail = $encrypter->encrypt($secondEmail); +.. _multiple-email-transports: + Multiple Email Transports ------------------------- diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 456fd5298a4..3e647d50e5d 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -151,6 +151,15 @@ Configuration * :ref:`name ` +* `mailer`_ + + * :ref:`dsn ` + * `transports`_ + * `envelope`_ + + * `sender`_ + * `recipients`_ + * `php_errors`_ * `log`_ @@ -159,7 +168,7 @@ Configuration * `profiler`_ * `collect`_ - * `dsn`_ + * :ref:`dsn ` * :ref:`enabled ` * `only_exceptions`_ * `only_master_requests`_ @@ -1075,6 +1084,8 @@ only_master_requests When this is set to ``true``, the profiler will only be enabled on the master requests (and not on the subrequests). +.. _profiler-dsn: + dsn ... @@ -2932,6 +2943,93 @@ Name of the lock you want to create. decorates: lock.invoice.store arguments: ['@lock.invoice.retry_till_save.store.inner', 100, 50] +mailer +~~~~~~ + +.. _mailer-dsn: + +dsn +... + +**type**: ``string`` + +The DSN used by the mailer. When several DSN may be used, use `transports` (see below) instead. + +transports +.......... + +**type**: ``array`` + +A :ref:`list of DSN ` that can be used by the mailer. A transport name is the key and the dsn is the value. + +envelope +........ + +sender +"""""" + +**type**: ``string`` + +Sender used by the `Mailer`. Keep in mind that this setting override a sender set in the code. + +recipients +"""""""""" + +**type**: ``array`` + +Recipients used by the `Mailer`. Keep in mind that this setting override recipients set in the code. + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/mailer.yaml + framework: + mailer: + dsn: 'smtp://localhost:25' + envelope: + recipients: ['admin@symfony.com', 'lead@symfony.com'] + + .. code-block:: xml + + + + + + + + + admin@symfony.com + lead@symfony.com + + + + + + .. code-block:: php + + // config/packages/mailer.php + namespace Symfony\Component\DependencyInjection\Loader\Configurator; + + return static function (ContainerConfigurator $containerConfigurator): void { + $containerConfigurator->extension('framework', [ + 'mailer' => [ + 'dsn' => 'smtp://localhost:25', + 'envelope' => [ + 'recipients' => [ + 'admin@symfony.com', + 'lead@symfony.com' + ] + ] + ] + ]); + }; + workflows ~~~~~~~~~