From 5b0797bcf3040e111b0ec6c3c9af2406ca2107ae Mon Sep 17 00:00:00 2001 From: Manuel Transfeld Date: Tue, 15 Oct 2019 16:51:31 +0200 Subject: [PATCH] Remove Address's argument Address has no second argument, so I removed it. NamedAddress can be used as alternative. --- mailer.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mailer.rst b/mailer.rst index 55096dd62aa..de111ec9179 100644 --- a/mailer.rst +++ b/mailer.rst @@ -146,9 +146,13 @@ both strings or address objects:: // email address as an object ->from(new Address('fabien@example.com')) - // email address as an object (email clients will display the name - // instead of the email address) - ->from(new NamedAddress('fabien@example.com', 'Fabien')) + // defining the email address and name as an object + // (email clients will display the name) + ->from(new Address('fabien@example.com')) + + // defining the email address and name as a string + // (the format must match: 'Name ') + ->from(Address::fromString('Fabien Potencier ')) // ... ; @@ -283,7 +287,7 @@ for Twig templates:: $email = (new TemplatedEmail()) ->from('fabien@example.com') - ->to(new NamedAddress('ryan@example.com', 'Ryan')) + ->to(new Address('ryan@example.com')) ->subject('Thanks for signing up!') // path of the Twig template to render