Skip to content
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('[email protected]')
->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('[email protected]')
->setTo('[email protected]')
->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 ``[email protected]``.

public function indexAction($name)
{
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
$message = new \Swift_Message('Hello Email')
->setFrom('[email protected]')
->setTo('[email protected]')
->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('[email protected]')
->setTo('[email protected]')
->setBody('You should see me from the profiler!')
Expand Down