Skip to content

Commit

Permalink
complete Swiftmailer XML examples
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Oct 2, 2015
1 parent 6df8cf7 commit 001e9c6
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 47 deletions.
44 changes: 26 additions & 18 deletions cookbook/email/dev_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ will not be sent when you run tests, but will continue to be sent in the
.. code-block:: xml
<!-- app/config/config_test.xml -->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd
-->
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config
disable-delivery="true" />
<swiftmailer:config disable-delivery="true" />
</container>
.. code-block:: php
Expand Down Expand Up @@ -70,13 +71,15 @@ via the ``delivery_address`` option:
.. code-block:: xml
<!-- app/config/config_dev.xml -->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd
-->
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config delivery-address="dev@example.com" />
<swiftmailer:config delivery-address="dev@example.com" />
</container>
.. code-block:: php
Expand Down Expand Up @@ -151,16 +154,21 @@ by adding the ``delivery_whitelist`` option:
<!-- app/config/config_dev.xml -->
<?xml version="1.0" charset="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config delivery-address="dev@example.com">
<!-- all email addresses matching this regex will *not* be redirected to dev@example.com -->
<swiftmailer:delivery-whitelist-pattern>/@specialdomain.com$/</swiftmailer:delivery-whitelist-pattern>
<swiftmailer:config delivery-address="dev@example.com">
<!-- all email addresses matching this regex will *not* be redirected to dev@example.com -->
<swiftmailer:delivery-whitelist-pattern>/@specialdomain.com$/</swiftmailer:delivery-whitelist-pattern>
<!-- all emails sent to admin@mydomain.com won't be redirected to dev@example.com too -->
<swiftmailer:delivery-whitelist-pattern>/^admin@mydomain.com$/</swiftmailer:delivery-whitelist-pattern>
</swiftmailer:config>
<!-- all emails sent to admin@mydomain.com won't be redirected to dev@example.com too -->
<swiftmailer:delivery-whitelist-pattern>/^admin@mydomain.com$/</swiftmailer:delivery-whitelist-pattern>
</swiftmailer:config>
</container>
.. code-block:: php
Expand Down
23 changes: 13 additions & 10 deletions cookbook/email/email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,20 @@ already included:
.. code-block:: xml
<!-- app/config/config.xml -->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd
-->
<swiftmailer:config
transport="%mailer_transport%"
host="%mailer_host%"
username="%mailer_user%"
password="%mailer_password%" />
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config
transport="%mailer_transport%"
host="%mailer_host%"
username="%mailer_user%"
password="%mailer_password%"
/>
</container>
.. code-block:: php
Expand Down
41 changes: 22 additions & 19 deletions cookbook/email/spool.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ swiftmailer with the memory option, use the following configuration:
.. code-block:: xml
<!-- app/config/config.xml -->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
http://symfony.com/schema/dic/swiftmailer
http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd
-->
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config>
<swiftmailer:spool type="memory" />
</swiftmailer:config>
<swiftmailer:config>
<swiftmailer:spool type="memory" />
</swiftmailer:config>
</container>
.. code-block:: php
Expand Down Expand Up @@ -73,18 +74,20 @@ In order to use the spool with a file, use the following configuration:
.. code-block:: xml
<!-- app/config/config.xml -->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
http://symfony.com/schema/dic/swiftmailer
http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd
-->
<swiftmailer:config>
<swiftmailer:spool
type="file"
path="/path/to/spool" />
</swiftmailer:config>
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
<swiftmailer:config>
<swiftmailer:spool
type="file"
path="/path/to/spool"
/>
</swiftmailer:config>
</container>
.. code-block:: php
Expand Down

0 comments on commit 001e9c6

Please sign in to comment.