File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Filter options
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::
146
146
// email address as an object
147
147
->from(new Address('fabien@example.com'))
148
148
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>'))
152
156
153
157
// ...
154
158
;
@@ -283,7 +287,7 @@ for Twig templates::
283
287
284
288
$email = (new TemplatedEmail())
285
289
->from('fabien@example.com')
286
- ->to(new NamedAddress ('ryan@example.com', 'Ryan '))
290
+ ->to(new Address ('ryan@example.com'))
287
291
->subject('Thanks for signing up!')
288
292
289
293
// path of the Twig template to render
You can’t perform that action at this time.
0 commit comments