8000 Syntax to create an email by grelu · Pull Request #7924 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Syntax to create an email #7924

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions controller/soap_web_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Copy link
Contributor

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.

->setTo('me@example.com')
->setSubject('Hello Service')
->setBody($name . ' says hi!');

$this->mailer->send($message);
Expand Down
3 changes: 1 addition & 2 deletions email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ an email is pretty straightforward::

public function indexAction($name)
{
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
$message = new \Swift_Message('Hello Email')
->setFrom('send@example.com')
->setTo('recipient@example.com')
->setBody(
Expand Down
3 changes: 1 addition & 2 deletions email/dev_environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ Now, suppose you're sending an email to ``recipient@example.com``.

public function indexAction($name)
{
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
$message = new \Swift_Message('Hello Email')
->setFrom('send@example.com')
->setTo('recipient@example.com')
->setBody(
Expand Down
3 changes: 1 addition & 2 deletions email/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Start with an easy controller action that sends an email::

public function sendEmailAction($name)
{
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
$message = new \Swift_Message('Hello Email')
->setFrom('send@example.com')
->setTo('recipient@example.com')
->setBody('You should see me from the profiler!')
Expand Down
0