10000 minor #7924 Syntax to create an email (grelu) · symfony/symfony-docs@8109074 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8109074

Browse files
committed
minor #7924 Syntax to create an email (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
2 parents 08d715e + f5f0f7c commit 8109074

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

controller/soap_web_service.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ In this case, the SOAP service will allow the client to call a method called
3939
public function hello($name)
4040
{
4141

42-
$message = \Swift_Message::newInstance()
42+
$message = new \Swift_Message('Hello Service')
4343
->setTo('me@example.com')
44-
->setSubject('Hello Service')
4544
->setBody($name . ' says hi!');
4645

4746
$this->mailer->send($message);

email.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ an email is pretty straightforward::
103103

104104
public function indexAction($name)
105105
{
106-
$message = \Swift_Message::newInstance()
107-
->setSubject('Hello Email')
106+
$message = new \Swift_Message('Hello Email')
108107
->setFrom('send@example.com')
109108
->setTo('recipient@example.com')
110109
->setBody(

email/dev_environment.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ Now, suppose you're sending an email to ``recipient@example.com``.
100100
101101
public function indexAction($name)
102102
{
103-
$message = \Swift_Message::newInstance()
104-
->setSubject('Hello Email')
103+
$message = new \Swift_Message('Hello Email')
105104
->setFrom('send@example.com')
106105
->setTo('recipient@example.com')
107106
->setBody(

email/testing.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ Start with an easy controller action that sends an email::
1414

1515
public function sendEmailAction($name)
1616
{
17-
$message = \Swift_Message::newInstance()
18-
->setSubject('Hello Email')
17+
$message = new \Swift_Message('Hello Email')
1918
->setFrom('send@example.com')
2019
->setTo('recipient@example.com')
2120
->setBody('You should see me from the profiler!')

0 commit comments

Comments
 (0)
0