File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments