8000 fix checking of mailer services in EmailSenderListener by smatyas · Pull Request #44 · symfony/swiftmailer-bundle · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 6, 2022. It is now read-only.

fix checking of mailer services in EmailSenderListener #44

Closed
wants to merge 2 commits into from

Conversation

smatyas
Copy link
Contributor
@smatyas smatyas commented Jul 25, 2013

The 'initialized' method of the Symfony\Component\DependencyInjection\Container does not handle aliases (as it is in the ContainerBuilder), but therefore the EmailSenderListener never sends emails.

This fix is related to issue #43.

return;
}
$mailers = array_keys($this->container->getParameter('swiftmailer.mailers'));
foreach ($mailers as $name) {
if ($this->container->initialized(sprintf('swiftmailer.mailer.%s', $name))) {
if ($this->container instanceof IntrospectableContainerInterface ? $this->container->initialized(sprintf('swiftmailer.mailer.%s', $name)) : $this->container->has(sprintf('swiftmailer.mailer.%s', $name))) {
Copy link
Member

Choose a reason for hiding this comment

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

$this->container->has(sprintf('swiftmailer.mailer.%s', $name)) is useless a useless condition: the container will always have it (as the swiftmailer.mailers parameter allows us to know what are the defined mailers)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, you're right!

@fabpot fabpot closed this in 6b52e41 Jul 26, 2013
@smatyas smatyas deleted the emailsenderlistener-fix branch July 26, 2013 12:21
smatyas referenced this pull request in symfony/symfony Sep 19, 2013
This PR was merged into the 2.2 branch.

Discussion
----------

[FrameworkBundle] made sure that the debug event dispatcher is used everywhere

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #6686, #7673
| License       | MIT
| Doc PR        | n/a

Commits
-------

f65a526 [FrameworkBundle] made sure that the debug event dispatcher is used everywhere
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0