Skip to content

Commit a906482

Browse files
committed
minor #12484 Remove Address's argument (auipga)
This PR was submitted for the master branch but it was merged into the 4.3 branch instead (closes #12484). Discussion ---------- Remove Address's argument Address has no second argument, so I removed it. NamedAddress can be used as alternative. I didn't write a bug for this. Commits ------- 5b0797b Remove Address's argument
2 parents 6a519f8 + 5b0797b commit a906482

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mailer.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@ both strings or address objects::
146146
// email address as an object
147147
->from(new Address('fabien@example.com'))
148148

149-
// email address as an object (email clients will display the name
150-
// instead of the email address)
151-
->from(new NamedAddress('fabien@example.com', 'Fabien'))
149+
// defining the email address and name as an object
150+
// (email clients will display the name)
151+
->from(new Address('fabien@example.com'))
152+
153+
// defining the email address and name as a string
154+
// (the format must match: 'Name <email@example.com>')
155+
->from(Address::fromString('Fabien Potencier <fabien@example.com>'))
152156

153157
// ...
154158
;
@@ -283,7 +287,7 @@ for Twig templates::
283287

284288
$email = (new TemplatedEmail())
285289
->from('fabien@example.com')
286-
->to(new NamedAddress('ryan@example.com', 'Ryan'))
290+
->to(new Address('ryan@example.com'))
287291
->subject('Thanks for signing up!')
288292

289293
// path of the Twig template to render

0 commit comments

Comments
 (0)