From 69d4f2f5d4bf57df1062888a8e43990c9e0530b1 Mon Sep 17 00:00:00 2001 From: Joeri Verdeyen Date: Mon, 28 Nov 2016 16:33:17 +0100 Subject: [PATCH 1/9] Update Swiftmailer configuration docs --- email.rst | 1 + email/dev_environment.rst | 6 +++--- reference/configuration/swiftmailer.rst | 13 +++++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/email.rst b/email.rst index 831f0006bbe..7f4f2034526 100644 --- a/email.rst +++ b/email.rst @@ -84,6 +84,7 @@ The following configuration attributes are available: * ``type`` (how to queue the messages, ``file`` or ``memory`` is supported, see :doc:`/email/spool`) * ``path`` (where to store the messages) * ``delivery_address`` (an email address where to send ALL emails) +* ``delivery_addresses`` (an array of email addresses where to send ALL emails) * ``disable_delivery`` (set to true to disable delivery completely) Sending Emails diff --git a/email/dev_environment.rst b/email/dev_environment.rst index c8bfc8b3e55..615a699f57c 100644 --- a/email/dev_environment.rst +++ b/email/dev_environment.rst @@ -53,12 +53,12 @@ will not be sent when you run tests, but will continue to be sent in the If you'd also like to disable deliver in the ``dev`` environment, simply add this same configuration to the ``config_dev.yml`` file. -Sending to a Specified Address +Sending to a Specified Address(es) ------------------------------ -You can also choose to have all email sent to a specific address, instead +You can also choose to have all email sent to a specific address or a list of addresses, instead of the address actually specified when sending the message. This can be done -via the ``delivery_address`` option: +via the ``delivery_address`` or ``delivery_addresses`` option: .. configuration-block:: diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst index 4e972d9e818..554945187ea 100644 --- a/reference/configuration/swiftmailer.rst +++ b/reference/configuration/swiftmailer.rst @@ -158,14 +158,21 @@ that all emails sent during development go to a single account. This uses ``Swift_Plugins_RedirectingPlugin``. Original recipients are available on the ``X-Swift-To``, ``X-Swift-Cc`` and ``X-Swift-Bcc`` headers. +delivery_addresses +~~~~~~~~~~~~~~~~ + +**type**: ``array`` + +If set, all email messages will be sent to this list of addresses, using the same logic as ``delivery_address``. + delivery_whitelist ~~~~~~~~~~~~~~~~~~ **type**: ``array`` -Used in combination with ``delivery_address``. If set, emails matching any +Used in combination with ``delivery_address`` or ``delivery_addresses``. If set, emails matching any of these patterns will be delivered like normal, as well as being sent to -``delivery_address``. For details, see the +``delivery_address`` or ``delivery_addresses``. For details, see the :ref:`How to Work with Emails during Development ` article. @@ -208,6 +215,7 @@ Full Default Configuration threshold: 99 sleep: 0 delivery_address: ~ + delivery_addresses: [] disable_delivery: ~ logging: '%kernel.debug%' @@ -230,6 +238,7 @@ Full Default Configuration auth_mode="" sender_address="" delivery_address="" + delivery_addresses="" disable_delivery="" logging="%kernel.debug%" > From e7135db5c234519ceebb4952f304994eaffecf71 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 28 Nov 2016 16:36:09 +0100 Subject: [PATCH 2/9] Fixed a minor syntax issue --- reference/configuration/swiftmailer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst index 554945187ea..d8c82f8e9a3 100644 --- a/reference/configuration/swiftmailer.rst +++ b/reference/configuration/swiftmailer.rst @@ -159,7 +159,7 @@ This uses ``Swift_Plugins_RedirectingPlugin``. Original recipients are available on the ``X-Swift-To``, ``X-Swift-Cc`` and ``X-Swift-Bcc`` headers. delivery_addresses -~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~ **type**: ``array`` From d7de32cc9372cd72f14c101aeced461fc2a5a750 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 28 Nov 2016 17:12:36 +0100 Subject: [PATCH 3/9] Fixed a minor syntax issue --- email/dev_environment.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/email/dev_environment.rst b/email/dev_environment.rst index 615a699f57c..15a1eafad82 100644 --- a/email/dev_environment.rst +++ b/email/dev_environment.rst @@ -54,7 +54,7 @@ If you'd also like to disable deliver in the ``dev`` environment, simply add this same configuration to the ``config_dev.yml`` file. Sending to a Specified Address(es) ------------------------------- +---------------------------------- You can also choose to have all email sent to a specific address or a list of addresses, instead of the address actually specified when sending the message. This can be done From 771f8b8b1af4dd9b77570a744e651c1aa44f880e Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 28 Nov 2016 17:14:34 +0100 Subject: [PATCH 4/9] Removed the mention to the deprecated delivery_address option --- email.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/email.rst b/email.rst index 7f4f2034526..91c2d5c233b 100644 --- a/email.rst +++ b/email.rst @@ -83,7 +83,6 @@ The following configuration attributes are available: * ``type`` (how to queue the messages, ``file`` or ``memory`` is supported, see :doc:`/email/spool`) * ``path`` (where to store the messages) -* ``delivery_address`` (an email address where to send ALL emails) * ``delivery_addresses`` (an array of email addresses where to send ALL emails) * ``disable_delivery`` (set to true to disable delivery completely) From d2c9a289c1fe0d25853d20c5cfee4986e8d151de Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 28 Nov 2016 17:16:46 +0100 Subject: [PATCH 5/9] Removed any mention of the deprecated delivery_address option --- email/dev_environment.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/email/dev_environment.rst b/email/dev_environment.rst index 15a1eafad82..3f7e75a8c30 100644 --- a/email/dev_environment.rst +++ b/email/dev_environment.rst @@ -58,7 +58,7 @@ Sending to a Specified Address(es) You can also choose to have all email sent to a specific address or a list of addresses, instead of the address actually specified when sending the message. This can be done -via the ``delivery_address`` or ``delivery_addresses`` option: +via the ``delivery_addresses`` option: .. configuration-block:: @@ -66,7 +66,7 @@ via the ``delivery_address`` or ``delivery_addresses`` option: # app/config/config_dev.yml swiftmailer: - delivery_address: 'dev@example.com' + delivery_addresses: ['dev@example.com'] .. code-block:: xml @@ -78,14 +78,14 @@ via the ``delivery_address`` or ``delivery_addresses`` option: xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> - + .. code-block:: php // app/config/config_dev.php $container->loadFromExtension('swiftmailer', array( - 'delivery_address' => "dev@example.com", + 'delivery_addresses' => array("dev@example.com"), )); Now, suppose you're sending an email to ``recipient@example.com``. @@ -139,7 +139,7 @@ by adding the ``delivery_whitelist`` option: # app/config/config_dev.yml swiftmailer: - delivery_address: dev@example.com + delivery_addresses: ['dev@example.com'] delivery_whitelist: # all email addresses matching these regexes will be delivered # like normal, as well as being sent to dev@example.com @@ -158,7 +158,7 @@ by adding the ``delivery_whitelist`` option: xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> - + /@specialdomain\.com$/ @@ -170,7 +170,7 @@ by adding the ``delivery_whitelist`` option: // app/config/config_dev.php $container->loadFromExtension('swiftmailer', array( - 'delivery_address' => "dev@example.com", + 'delivery_addresses' => array("dev@example.com"), 'delivery_whitelist' => array( // all email addresses matching these regexes will be delivered // like normal, as well as being sent to dev@example.com From 0df8929b5493e67f854f714284958a6a0531e435 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 28 Nov 2016 17:19:44 +0100 Subject: [PATCH 6/9] Removed the description of the deprecated `delivery_address` option --- reference/configuration/swiftmailer.rst | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst index d8c82f8e9a3..a0bfe6c7fc9 100644 --- a/reference/configuration/swiftmailer.rst +++ b/reference/configuration/swiftmailer.rst @@ -145,26 +145,23 @@ sleep Used with ``Swift_Plugins_AntiFloodPlugin``. This is the number of seconds to sleep for during a transport restart. -delivery_address -~~~~~~~~~~~~~~~~ +delivery_addresses +~~~~~~~~~~~~~~~~~~ -**type**: ``string`` +**type**: ``array`` + +.. note:: + + In previous versions, this option was called ``delivery_address`` -If set, all email messages will be sent to this address instead of being +If set, all email messages will be sent to these addresses instead of being sent to their actual recipients. This is often useful when developing. For example, by setting this in the ``config_dev.yml`` file, you can guarantee -that all emails sent during development go to a single account. +that all emails sent during development go to one or more some specific accounts. This uses ``Swift_Plugins_RedirectingPlugin``. Original recipients are available on the ``X-Swift-To``, ``X-Swift-Cc`` and ``X-Swift-Bcc`` headers. -delivery_addresses -~~~~~~~~~~~~~~~~~~ - -**type**: ``array`` - -If set, all email messages will be sent to this list of addresses, using the same logic as ``delivery_address``. - delivery_whitelist ~~~~~~~~~~~~~~~~~~ From 7e5e1efb02d99afb64f94932b048a4ad387ef9ff Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 29 Nov 2016 10:20:58 +0100 Subject: [PATCH 7/9] delivery adresses are separate XML element nodes --- email/dev_environment.rst | 7 +++++-- reference/configuration/swiftmailer.rst | 3 --- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/email/dev_environment.rst b/email/dev_environment.rst index 3f7e75a8c30..38a952bbf00 100644 --- a/email/dev_environment.rst +++ b/email/dev_environment.rst @@ -78,7 +78,9 @@ via the ``delivery_addresses`` option: xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> - + + dev@example.com + .. code-block:: php @@ -158,11 +160,12 @@ by adding the ``delivery_whitelist`` option: xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd"> - + /@specialdomain\.com$/ /^admin@mydomain\.com$/ + dev@example.com diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst index a0bfe6c7fc9..dc94898d69b 100644 --- a/reference/configuration/swiftmailer.rst +++ b/reference/configuration/swiftmailer.rst @@ -211,7 +211,6 @@ Full Default Configuration antiflood: threshold: 99 sleep: 0 - delivery_address: ~ delivery_addresses: [] disable_delivery: ~ logging: '%kernel.debug%' @@ -234,8 +233,6 @@ Full Default Configuration encryption="" auth_mode="" sender_address="" - delivery_address="" - delivery_addresses="" disable_delivery="" logging="%kernel.debug%" > From 9ac7f596626b18d349a94de8938c3b6ff43b5a5d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 29 Nov 2016 10:23:21 +0100 Subject: [PATCH 8/9] add labels for old headlines --- email/dev_environment.rst | 2 ++ reference/configuration/swiftmailer.rst | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/email/dev_environment.rst b/email/dev_environment.rst index 38a952bbf00..42ba08ed9bb 100644 --- a/email/dev_environment.rst +++ b/email/dev_environment.rst @@ -53,6 +53,8 @@ will not be sent when you run tests, but will continue to be sent in the If you'd also like to disable deliver in the ``dev`` environment, simply add this same configuration to the ``config_dev.yml`` file. +.. _sending-to-a-specified-address: + Sending to a Specified Address(es) ---------------------------------- diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst index dc94898d69b..712dcfd2009 100644 --- a/reference/configuration/swiftmailer.rst +++ b/reference/configuration/swiftmailer.rst @@ -32,7 +32,7 @@ Configuration * `antiflood`_ * `threshold`_ * `sleep`_ -* `delivery_address`_ +* `delivery_addresses`_ * `delivery_whitelist`_ * `disable_delivery`_ * `logging`_ @@ -145,6 +145,8 @@ sleep Used with ``Swift_Plugins_AntiFloodPlugin``. This is the number of seconds to sleep for during a transport restart. +.. _delivery-address: + delivery_addresses ~~~~~~~~~~~~~~~~~~ From b3864c54275db30827734be07b0d058f787df5c1 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 29 Nov 2016 10:46:35 +0100 Subject: [PATCH 9/9] add missing dot at the end of sentence --- reference/configuration/swiftmailer.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/configuration/swiftmailer.rst b/reference/configuration/swiftmailer.rst index 712dcfd2009..1d6a1a81150 100644 --- a/reference/configuration/swiftmailer.rst +++ b/reference/configuration/swiftmailer.rst @@ -154,7 +154,7 @@ delivery_addresses .. note:: - In previous versions, this option was called ``delivery_address`` + In previous versions, this option was called ``delivery_address``. If set, all email messages will be sent to these addresses instead of being sent to their actual recipients. This is often useful when developing. For