Skip to content

Commit b34d046

Browse files
committed
Update Swiftmailer configuration docs
Added `delivery_addresses` configuration.
1 parent 22ca5b8 commit b34d046

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

email.rst

Lines 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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,20 @@ 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
56+
Sending to a Specified Addresses
5757
------------------------------
5858

59-
You can also choose to have all email sent to a specific address, instead
59+
You can also choose to have all email sent to specific addresses, instead
6060
of the address actually specified when sending the message. This can be done
61-
via the ``delivery_address`` option:
61+
via the ``delivery_addresses`` option:
6262

6363
.. configuration-block::
6464

6565
.. code-block:: yaml
6666
6767
# app/config/config_dev.yml
6868
swiftmailer:
69-
delivery_address: 'dev@example.com'
69+
delivery_addresses: ['dev@example.com']
7070
7171
.. code-block:: xml
7272
@@ -78,14 +78,14 @@ via the ``delivery_address`` option:
7878
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
7979
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
8080
81-
<swiftmailer:config delivery-address="dev@example.com" />
81+
<swiftmailer:config delivery-addresses="dev@example.com" />
8282
</container>
8383
8484
.. code-block:: php
8585
8686
// app/config/config_dev.php
8787
$container->loadFromExtension('swiftmailer', array(
88-
'delivery_address' => "dev@example.com",
88+
'delivery_address' => array("dev@example.com"),
8989
));
9090
9191
Now, suppose you're sending an email to ``recipient@example.com``.
@@ -139,7 +139,7 @@ by adding the ``delivery_whitelist`` option:
139139
140140
# app/config/config_dev.yml
141141
swiftmailer:
142-
delivery_address: dev@example.com
142+
delivery_addresses: dev@example.com
143143
delivery_whitelist:
144144
# all email addresses matching these regexes will be delivered
145145
# like normal, as well as being sent to dev@example.com
@@ -170,7 +170,7 @@ by adding the ``delivery_whitelist`` option:
170170
171171
// app/config/config_dev.php
172172
$container->loadFromExtension('swiftmailer', array(
173-
'delivery_address' => "dev@example.com",
173+
'delivery_addresses' => array("dev@example.com"),
174174
'delivery_whitelist' => array(
175175
// all email addresses matching these regexes will be delivered
176176
// like normal, as well as being sent to dev@example.com

reference/configuration/swiftmailer.rst

Lines changed: 11 additions & 9 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,27 +145,29 @@ 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
148+
delivery_addresses
149149
~~~~~~~~~~~~~~~~
150150

151-
**type**: ``string``
151+
**type**: ``array``
152152

153-
If set, all email messages will be sent to this address instead of being
153+
If set, all email messages will be sent to these addresses instead of being
154154
sent to their actual recipients. This is often useful when developing. For
155155
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.
156+
that all emails sent during development go to the specified recipients.
157157

158158
This uses ``Swift_Plugins_RedirectingPlugin``. Original recipients are available
159159
on the ``X-Swift-To``, ``X-Swift-Cc`` and ``X-Swift-Bcc`` headers.
160160

161+
Warning: ``delivery_addresses`` was previously called ``delivery_address``.
162+
161163
delivery_whitelist
162164
~~~~~~~~~~~~~~~~~~
163165

164166
**type**: ``array``
165167

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

@@ -207,7 +209,7 @@ Full Default Configuration
207209
antiflood:
208210
threshold: 99
209211
sleep: 0
210-
delivery_address: ~
212+
delivery_addresses: ~
211213
disable_delivery: ~
212214
logging: '%kernel.debug%'
213215
@@ -229,7 +231,7 @@ Full Default Configuration
229231
encryption=""
230232
auth_mode=""
231233
sender_address=""
232-
delivery_address=""
234+
delivery_addresses=""
233235
disable_delivery=""
234236
logging="%kernel.debug%"
235237
>

0 commit comments

Comments
 (0)