Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 67b763e

Browse filesBrowse files
committed
minor #7152 Update Swiftmailer configuration docs (jverdeyen, javiereguiluz, xabbuh)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #7152). Discussion ---------- Update Swiftmailer configuration docs Added `delivery_addresses` configuration. Commits ------- bbc673a add missing dot at the end of sentence 45cbc55 add labels for old headlines 2c97e50 delivery adresses are separate XML element nodes daaa24a Removed the description of the deprecated `delivery_address` option 55c38a6 Removed any mention of the deprecated delivery_address option ea508f9 Removed the mention to the deprecated delivery_address option 56f6f53 Fixed a minor syntax issue 2f58823 Fixed a minor syntax issue 660aaa1 Update Swiftmailer configuration docs
2 parents 8dfc46f + bbc673a commit 67b763e
Copy full SHA for 67b763e

File tree

3 files changed

+31
-21
lines changed
Filter options

3 files changed

+31
-21
lines changed

‎email.rst

Copy file name to clipboardExpand all lines: email.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The following configuration attributes are available:
8383

8484
* ``type`` (how to queue the messages, ``file`` or ``memory`` is supported, see :doc:`/email/spool`)
8585
* ``path`` (where to store the messages)
86-
* ``delivery_address`` (an email address where to send ALL emails)
86+
* ``delivery_addresses`` (an array of email addresses where to send ALL emails)
8787
* ``disable_delivery`` (set to true to disable delivery completely)
8888

8989
Sending Emails

‎email/dev_environment.rst

Copy file name to clipboardExpand all lines: email/dev_environment.rst
+15-10Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,22 @@ will not be sent when you run tests, but will continue to be sent in the
5353
If you'd also like to disable deliver in the ``dev`` environment, simply
5454
add this same configuration to the ``config_dev.yml`` file.
5555

56-
Sending to a Specified Address
57-
------------------------------
56+
.. _sending-to-a-specified-address:
5857

59-
You can also choose to have all email sent to a specific address, instead
58+
Sending to a Specified Address(es)
59+
----------------------------------
60+
61+
You can also choose to have all email sent to a specific address or a list of addresses, instead
6062
of the address actually specified when sending the message. This can be done
61-
via the ``delivery_address`` option:
63+
via the ``delivery_addresses`` option:
6264

6365
.. configuration-block::
6466

6567
.. code-block:: yaml
6668
6769
# app/config/config_dev.yml
6870
swiftmailer:
69-
delivery_address: 'dev@example.com'
71+
delivery_addresses: ['dev@example.com']
7072
7173
.. code-block:: xml
7274
@@ -78,14 +80,16 @@ via the ``delivery_address`` option:
7880
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
7981
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
8082
81-
<swiftmailer:config delivery-address="dev@example.com" />
83+
<swiftmailer:config>
84+
<swiftmailer:delivery-address>dev@example.com</swiftmailer:delivery-address>
85+
</swiftmailer:config>
8286
</container>
8387
8488
.. code-block:: php
8589
8690
// app/config/config_dev.php
8791
$container->loadFromExtension('swiftmailer', array(
88-
'delivery_address' => "dev@example.com",
92+
'delivery_addresses' => array("dev@example.com"),
8993
));
9094
9195
Now, suppose you're sending an email to ``recipient@example.com``.
@@ -139,7 +143,7 @@ by adding the ``delivery_whitelist`` option:
139143
140144
# app/config/config_dev.yml
141145
swiftmailer:
142-
delivery_address: dev@example.com
146+
delivery_addresses: ['dev@example.com']
143147
delivery_whitelist:
144148
# all email addresses matching these regexes will be delivered
145149
# like normal, as well as being sent to dev@example.com
@@ -158,19 +162,20 @@ by adding the ``delivery_whitelist`` option:
158162
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
159163
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
160164
161-
<swiftmailer:config delivery-address="dev@example.com">
165+
<swiftmailer:config>
162166
<!-- all email addresses matching these regexes will be delivered
163167
like normal, as well as being sent to dev@example.com -->
164168
<swiftmailer:delivery-whitelist-pattern>/@specialdomain\.com$/</swiftmailer:delivery-whitelist-pattern>
165169
<swiftmailer:delivery-whitelist-pattern>/^admin@mydomain\.com$/</swiftmailer:delivery-whitelist-pattern>
170+
<swiftmailer:delivery-address>dev@example.com</swiftmailer:delivery-address>
166171
</swiftmailer:config>
167172
</container>
168173
169174
.. code-block:: php
170175
171176
// app/config/config_dev.php
172177
$container->loadFromExtension('swiftmailer', array(
173-
'delivery_address' => "dev@example.com",
178+
'delivery_addresses' => array("dev@example.com"),
174179
'delivery_whitelist' => array(
175180
// all email addresses matching these regexes will be delivered
176181
// like normal, as well as being sent to dev@example.com

‎reference/configuration/swiftmailer.rst

Copy file name to clipboardExpand all lines: reference/configuration/swiftmailer.rst
+15-10Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Configuration
3232
* `antiflood`_
3333
* `threshold`_
3434
* `sleep`_
35-
* `delivery_address`_
35+
* `delivery_addresses`_
3636
* `delivery_whitelist`_
3737
* `disable_delivery`_
3838
* `logging`_
@@ -145,15 +145,21 @@ sleep
145145
Used with ``Swift_Plugins_AntiFloodPlugin``. This is the number of seconds
146146
to sleep for during a transport restart.
147147

148-
delivery_address
149-
~~~~~~~~~~~~~~~~
148+
.. _delivery-address:
150149

151-
**type**: ``string``
150+
delivery_addresses
151+
~~~~~~~~~~~~~~~~~~
152+
153+
**type**: ``array``
154+
155+
.. note::
156+
157+
In previous versions, this option was called ``delivery_address``.
152158

153-
If set, all email messages will be sent to this address instead of being
159+
If set, all email messages will be sent to these addresses instead of being
154160
sent to their actual recipients. This is often useful when developing. For
155161
example, by setting this in the ``config_dev.yml`` file, you can guarantee
156-
that all emails sent during development go to a single account.
162+
that all emails sent during development go to one or more some specific accounts.
157163

158164
This uses ``Swift_Plugins_RedirectingPlugin``. Original recipients are available
159165
on the ``X-Swift-To``, ``X-Swift-Cc`` and ``X-Swift-Bcc`` headers.
@@ -163,9 +169,9 @@ delivery_whitelist
163169

164170
**type**: ``array``
165171

166-
Used in combination with ``delivery_address``. If set, emails matching any
172+
Used in combination with ``delivery_address`` or ``delivery_addresses``. If set, emails matching any
167173
of these patterns will be delivered like normal, as well as being sent to
168-
``delivery_address``. For details, see the
174+
``delivery_address`` or ``delivery_addresses``. For details, see the
169175
:ref:`How to Work with Emails during Development <sending-to-a-specified-address-but-with-exceptions>`
170176
article.
171177

@@ -207,7 +213,7 @@ Full Default Configuration
207213
antiflood:
208214
threshold: 99
209215
sleep: 0
210-
delivery_address: ~
216+
delivery_addresses: []
211217
disable_delivery: ~
212218
logging: '%kernel.debug%'
213219
@@ -229,7 +235,6 @@ Full Default Configuration
229235
encryption=""
230236
auth_mode=""
231237
sender_address=""
232-
delivery_address=""
233238
disable_delivery=""
234239
logging="%kernel.debug%"
235240
>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.