-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Syntax to create an email #7924 8000
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
With swiftmailer v6.0.1 and Symfony 3.2.8, the good syntax to create an email is : $message = new \Swift_Message('Hello Email');
We can't assume that users have 6.0 yet. But, the Also, there are other spots we need to update - you can find them if you run:
Thanks - we have to make sure the details are correct, but this is a good change. And the old way definitely does not work in Swiftmailer 6 |
Apparently, no, it's a new method to create a message in 6.0. I have read the 5.x version of the documentation and it is not the same way of doing things : |
Hmm, but check out the |
In other words 👍 - I think this is ready for merge... and into the 2.7 branch: this syntax appears to always have been valid. Status: Reviewed |
Perfect ! |
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 agree with Ryan. The newInstance()
method didn't do anything special in 5.x version, so it's safe to update this.
👍 @grelu thanks for fixing this and congrats on your first contribution to docs!
You're welcome and thank you ! |
Thank you @grelu. |
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes #7924). Discussion ---------- Syntax to create an email With swiftmailer 6.0.1 and Symfony 3.2.8, the good syntax to create an email is : $message = new \Swift_Message('Hello Email'); Commits ------- f5f0f7c Syntax to create an email
@@ -39,9 +39,8 @@ In this case, the SOAP service will allow the client to call a method called | |||
public function hello($name) | |||
{ | |||
|
|||
$message = \Swift_Message::newInstance() | |||
$message = new \Swift_Message('Hello Service') |
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 an implementation detail, we should use $message = $this->mailer->createMessage()
instead.
With swiftmailer 6.0.1 and Symfony 3.2.8, the good syntax to create an email is :
$message = new \Swift_Message('Hello Email');