- Issue created by @abramm
- Merge request !7Issue #3494248: Support passing email with display name for To, CC, BCC, Reply-To fields β (Open) created by abramm
The \Drupal\sendgrid\SendgridHandler::sendMail()
method expects emails set in to
, cc
, bcc
and reply-to
keys of the $message
argument to be emails formatted as username@domain.com
format.
However, that's not always the case as the address may also be formatted as Display Name <username@domain.com>
.
This causes validation failure in the SendGrid library:
Error code 0: "$emailAddress" must be a valid email address. Got: Display Name <username@domain.com>
Send an email to the recipient formatted as Display Name <username@domain.com>
.
Add a helper method parsing the email input string, optionally extracting the display name to be passed to addTo
, addC
, and other similar methods of the \SendGrid\Mail\Mail
class.
None.
None.
None.
Active
1.0
Code