@@ -119,11 +119,11 @@ the replaced address, so you can still see who it would have been sent to.
119
119
These are ``X-Swift-Cc `` and ``X-Swift-Bcc `` for the ``CC `` and ``BCC ``
120
120
addresses respectively.
121
121
122
- Sending to a Specified Address, but with exceptions
123
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122
+ Sending to a Specified Address but with Exceptions
123
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124
124
125
125
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 ``).
127
127
But then you may want email sent to some specific email addresses to go through
128
128
after all, and not be redirected (even if it is in the dev environment).
129
129
This can be done by adding the ``delivery_whitelist `` option:
@@ -154,22 +154,30 @@ This can be done by adding the ``delivery_whitelist`` option:
154
154
-->
155
155
156
156
<swiftmailer : config delivery-address =" [email protected] " />
157
+ <!-- all email addresses matching this regex will *not* be redirected to [email protected] -->
157
158
<swiftmailer : delivery-whitelist >/@mydomain.com$/</swiftmailer : delivery-whitelist >
159
+ <!-- all emails sent to [email protected] won't be redirected to [email protected] too -->
158
160
<swiftmailer : delivery-whitelist >/^[email protected] $/</swiftmailer : delivery-whitelist >
161
+
159
162
.. code-block :: php
160
163
161
164
// app/config/config_dev.php
162
165
$container->loadFromExtension('swiftmailer', array(
163
166
'delivery_address' => "[email protected] ",
164
167
'delivery_whitelist' => array(
168
+ // all email addresses matching this regex will *not* be
169
+ // redirected to [email protected]
165
170
'/@mydomain.com$/',
171
+
172
+ // all emails sent to [email protected] won't be
173
+ // redirected to [email protected] too
166
174
167
175
),
168
176
));
169
177
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.
173
181
174
182
Viewing from the Web Debug Toolbar
175
183
----------------------------------
0 commit comments