$sender_cloned->mail =
$message->
getSenderMail();
// For the email message, clarify that the sender name is not verified; it
// could potentially clash with a username on this site.
$sender_cloned->name =
$this->
t('@name (not verified)',
['@name' =>
$message->
getSenderName()]);
} // Build email parameters.
$params['contact_message'
] =
$message;
$params['sender'
] =
$sender_cloned;
if (!
$message->
isPersonal()) { // Send to the form recipient(s), using the site's default language.
$params['contact_form'
] =
$contact_form;
$to =
implode(', ',
$contact_form->
getRecipients());
} elseif ($recipient =
$message->
getPersonalRecipient()) { // Send to the user in the user's preferred language.
$to =
$recipient->
getEmail();
$recipient_langcode =
$recipient->
getPreferredLangcode();
$params['recipient'
] =
$recipient;
}