Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe configuration behaviour with multiple mailers #5724

Closed
wants to merge 2 commits into from
Closed

Describe configuration behaviour with multiple mailers #5724

wants to merge 2 commits into from

Conversation

xelan
Copy link
Contributor

@xelan xelan commented Sep 25, 2015

Q A
Doc fix? yes
New docs? yes
Applies to all
Fixed tickets symfony/swiftmailer-bundle#111

This PR describes the behaviour when multiple mailers are configured.


The configuration in the ``swiftmailer`` key (see above) is a shortcut
syntax for the default mailer. If you use multiple mailers, you need to
set options like ``disable_delivery`` separately for the additional mailers.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reword this a bit:

.. caution::

    When configuring multiple mailers, options must be placed under the appropriate
    mailer key of the configuration. Options placed directly under the `swiftmailer`
    key will not be applied to all mailers, but will configure a mailer named
    ``default`` instead.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Christian, I think your wording sounds great and explains the issue well.
If i interpret the configuration code correctly, the default mailer doesn't have to be named default, but it has to be configured as default_mailer.

Edit: Oh, seems like it simply uses the name default regardless of the configured default_mailer - This surprised me again 😄

I'll push a new commit to my PR which contains your rewording.

@xabbuh
Copy link
Member

xabbuh commented Sep 26, 2015

Thanks @xelan for making the documentation better! I have left just one minor suggestion. What do you think about it?

@xabbuh
Copy link
Member

xabbuh commented Sep 30, 2015

👍

1 similar comment
@sstok
Copy link
Contributor

sstok commented Oct 1, 2015

👍

@xabbuh
Copy link
Member

xabbuh commented Oct 3, 2015

Hm, looking at the code again I think this only true if you do not change the default mailer using the default_mailer option (which defaults to default).

@stof What do you think?

@stof
Copy link
Member

stof commented Oct 3, 2015

@xabbuh using the shorthand syntax in multiple files with a non-default name for the mailer indeed works only if you redefine the name in all files (the same is true for Doctrine shortcuts btw).
Anyway, the recommendation should be to never use the short syntax if you use multiple mailers (and to avoid changing the mailer name if you use only one, as you don't care about the name anyway in such case)

@arderyp
Copy link
Contributor

arderyp commented Nov 30, 2015

Thanks @stof, @xelan, and everyone else for this info/work.

wouterj added a commit that referenced this pull request Feb 6, 2016
…(xelan)

This PR was squashed before being merged into the 2.3 branch (closes #5724).

Discussion
----------

Describe configuration behaviour with multiple mailers

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | yes
| Applies to    | all
| Fixed tickets | symfony/swiftmailer-bundle#111

This PR describes the behaviour when multiple mailers are configured.

Commits
-------

887e8ba Describe configuration behaviour with multiple mailers
wouterj added a commit that referenced this pull request Feb 6, 2016
@wouterj
Copy link
Member

wouterj commented Feb 6, 2016

Thanks @xelan for your contribution! I've merged your PR into the 2.3 branch. After the merge, I've changed the wording a bit in 34c0771 to not explain what happends if someone doesn't follow this recommendation (they should simply never do it).

@wouterj wouterj closed this Feb 6, 2016
@xelan xelan deleted the swiftmailer-multiple-mailers branch February 10, 2016 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants