-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SwiftmailerBridge] Added mailers #8005
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
Conversation
Works like a cham with symfony/swiftmailer-bundle#34 😼 |
@fabpot this logger is highly tied to the bundle. It is not usable standalone as it uses the container to lazy-load the mailer (because of the heavy Swiftmailer initialization). Should we move it to the bundle ? |
{ | ||
return $this->data['isSpool']; | ||
return $this->data['defaultMailer'] == $name ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==
already gives you a boolean
@fabpot What do you think about moving the bundle-specific collector to the bundle ? |
👍 |
Thanks @stof, @fabpot I think @jeremyFreeAgent can have a window to make the changes ASAP, what's your point ? |
@fabpot What do you think about moving the bundle-specific collector to the bundle ? |
👍 |
public function isSpool($name) | ||
{ | ||
if ($data = $this->getMailerData($name)) { | ||
return $data['isSpool']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be wrong but it seems that the "isSpool" key may not exist as it is set in a if
statement and not at the end of the collect
method as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benja-M-1 you're right but this method depends ont the fact that MailerData is filled or not... so, first it should throw a LogicErrorException if MailerData we're looking for is not set because we have to collect data before.
And then it could test the isSpool key indeed... or at collect time $data
could be initialized with default values.
@jeremyFreeAgent what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes a LogicException is good. Thanks @benja-M-1 and @shouze !
very good addition |
@fabpot now that sf2.3 is out, would you please give your advice about that?
|
ping @fabpot ! |
* | ||
* @return array The messages. | ||
*/ | ||
public function getMessages($name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is BC Break against https://github.com/symfony/SwiftmailerBridge/blob/master/DataCollector/MessageDataCollector.php#L68
+1 |
I'd like this collector to work with both the old single mailer and the new mailers, so that we don't have to raise the min version. |
Hi, I've moved the DataCollector in the Bundle with the PR symfony/swiftmailer-bundle#34. Maybe one day the DataCollector will be removed. So what about removing it in this PR and merge it when winter is coming ? |
The best thing to do is to deprecate the collector and mark it to be removed in Symfony 3.0. |
I've opened a new PR for that #8520. |
Now you can configure several mailers.
Linked to the following PR: