@@ -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
125125Suppose 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 ``).
127127But then you may want email sent to some specific email addresses to go through
128128after all, and not be redirected (even if it is in the dev environment).
129129This 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 =" dev@example.com" />
157+ <!-- all email addresses matching this regex will *not* be redirected to dev@example.com -->
157158 <swiftmailer : delivery-whitelist >/@mydomain.com$/</swiftmailer : delivery-whitelist >
159+ <!-- all emails sent to admin@specialdomain.com won't be redirected to dev@example.com too -->
158160 <swiftmailer : delivery-whitelist >/^admin@specialdomain.com$/</swiftmailer : delivery-whitelist >
161+
159162 .. code-block :: php
160163
161164 // app/config/config_dev.php
162165 $container->loadFromExtension('swiftmailer', array(
163166 'delivery_address' => "dev@example.com",
164167 'delivery_whitelist' => array(
168+ // all email addresses matching this regex will *not* be
169+ // redirected to dev@example.com
165170 '/@mydomain.com$/',
171+
172+ // all emails sent to admin@specialdomain.com won't be
173+ // redirected to dev@example.com too
166174 '/^admin@specialdomain.com$/'
167175 ),
168176 ));
169177
170- In the above example all mail will be redirected to ``dev@example.com ``,
171- except that mail to the single address ``admin@specialdomain.com `` 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 ``dev@example.com ``,
179+ except messages sent to the ``admin@specialdomain.com `` address or to any email
180+ address belonging to the domain ``mydomain.com ``, which will be delivered as normal.
173181
174182Viewing from the Web Debug Toolbar
175183----------------------------------
0 commit comments