Skip to content

Commit 8c1da8a

Browse files
TerjeBrweaverryan
authored andcommitted
Changes recommended by @javierguiluz
1 parent 4aa58a4 commit 8c1da8a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

cookbook/email/dev_environment.rst

+14-6
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ the replaced address, so you can still see who it would have been sent to.
119119
These are ``X-Swift-Cc`` and ``X-Swift-Bcc`` for the ``CC`` and ``BCC``
120120
addresses respectively.
121121

122-
Sending to a Specified Address, but with exceptions
123-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122+
Sending to a Specified Address but with Exceptions
123+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124124

125125
Suppose you normally in your dev environment want to have all email redirected
126-
to a specific address, (like in the above scenario to ``dev@example,com``).
126+
to a specific address, (like in the above scenario to ``dev@example.com``).
127127
But then you may want email sent to some specific email addresses to go through
128128
after all, and not be redirected (even if it is in the dev environment).
129129
This can be done by adding the ``delivery_whitelist`` option:
@@ -154,22 +154,30 @@ This can be done by adding the ``delivery_whitelist`` option:
154154
-->
155155
156156
<swiftmailer:config delivery-address="[email protected]" />
157+
<!-- all email addresses matching this regex will *not* be redirected to [email protected] -->
157158
<swiftmailer:delivery-whitelist>/@mydomain.com$/</swiftmailer:delivery-whitelist>
159+
<!-- all emails sent to [email protected] won't be redirected to [email protected] too -->
158160
<swiftmailer:delivery-whitelist>/^[email protected]$/</swiftmailer:delivery-whitelist>
161+
159162
.. code-block:: php
160163
161164
// app/config/config_dev.php
162165
$container->loadFromExtension('swiftmailer', array(
163166
'delivery_address' => "[email protected]",
164167
'delivery_whitelist' => array(
168+
// all email addresses matching this regex will *not* be
169+
// redirected to [email protected]
165170
'/@mydomain.com$/',
171+
172+
// all emails sent to [email protected] won't be
173+
// redirected to [email protected] too
166174
167175
),
168176
));
169177
170-
In the above example all mail will be redirected to ``[email protected]``,
171-
except that mail to the single address ``[email protected]`` and all
172-
mail to the domain ``mydomain.com`` will be delivered as normal.
178+
In the above example all email messages will be redirected to ``[email protected]``,
179+
except messages sent to the ``[email protected]`` address or to any email
180+
address belonging to the domain ``mydomain.com``, which will be delivered as normal.
173181

174182
Viewing from the Web Debug Toolbar
175183
----------------------------------

0 commit comments

Comments
 (0)