Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a906482

Browse filesBrowse 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
Copy full SHA for a906482

File tree

Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed

‎mailer.rst

Copy file name to clipboardExpand all lines: mailer.rst
+8-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.