-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 2.3: (45 commits) More xml fixes Xml changes and line-break changes Swiched mydomain and specialdomain Changes recommended by @cordoval Changes recommended by @javierguiluz Changed line-breaks in text Added improvments from @wouterj fixed typo in "except" Document whitelist option to email redirect Typo Improve assetic:watch text Update asset_management.rst Link to standard edition so users can get the app/AppKernel.php if needed. Update tests.rst ensure consistency with the note Update security.rst minor #4977 Unnecessary comma (edsonmedina) Wrong comma file extension fix Fixed some syntax issues in Twig Reference ... Conflicts: cookbook/session/index.rst reference/twig_reference.rst
- Loading branch information
Showing
28 changed files
with
212 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ can easily achieve this through configuration settings without having to | |
make any changes to your application's code at all. There are two main | ||
choices when it comes to handling email during development: (a) disabling the | ||
sending of email altogether or (b) sending all email to a specific | ||
address. | ||
address (with optional exceptions). | ||
|
||
Disabling Sending | ||
----------------- | ||
|
@@ -119,6 +119,67 @@ the replaced address, so you can still see who it would have been sent to. | |
These are ``X-Swift-Cc`` and ``X-Swift-Bcc`` for the ``CC`` and ``BCC`` | ||
addresses respectively. | ||
|
||
Sending to a Specified Address but with Exceptions | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Suppose you want to have all email redirected to a specific address, | ||
(like in the above scenario to ``[email protected]``). But then you may want | ||
email sent to some specific email addresses to go through after all, and | ||
not be redirected (even if it is in the dev environment). This can be done | ||
by adding the ``delivery_whitelist`` option: | ||
|
||
.. configuration-block:: | ||
|
||
.. code-block:: yaml | ||
# app/config/config_dev.yml | ||
swiftmailer: | ||
delivery_address: [email protected] | ||
delivery_whitelist: | ||
# all email addresses matching this regex will *not* be | ||
# redirected to [email protected] | ||
- "/@specialdomain.com$/" | ||
# all emails sent to [email protected] won't | ||
# be redirected to [email protected] too | ||
- "/^[email protected]$/" | ||
.. code-block:: xml | ||
<!-- app/config/config_dev.xml --> | ||
<?xml version="1.0" charset="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"> | ||
<swiftmailer:config delivery-address="[email protected]"> | ||
<!-- all email addresses matching this regex will *not* be redirected to [email protected] --> | ||
<swiftmailer:delivery-whitelist-pattern>/@specialdomain.com$/</swiftmailer:delivery-whitelist-pattern> | ||
<!-- all emails sent to [email protected] won't be redirected to [email protected] too --> | ||
<swiftmailer:delivery-whitelist-pattern>/^[email protected]$/</swiftmailer:delivery-whitelist-pattern> | ||
</swiftmailer:config> | ||
.. code-block:: php | ||
// app/config/config_dev.php | ||
$container->loadFromExtension('swiftmailer', array( | ||
'delivery_address' => "[email protected]", | ||
'delivery_whitelist' => array( | ||
// all email addresses matching this regex will *not* be | ||
// redirected to [email protected] | ||
'/@specialdomain.com$/', | ||
// all emails sent to [email protected] won't be | ||
// redirected to [email protected] too | ||
'/^[email protected]$/', | ||
), | ||
)); | ||
In the above example all email messages will be redirected to ``[email protected]``, | ||
except messages sent to the ``[email protected]`` address or to any email | ||
address belonging to the domain ``specialdomain.com``, which will be delivered as normal. | ||
|
||
Viewing from the Web Debug Toolbar | ||
---------------------------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.