return $response;
} /**
* @return list<array{email: string, name?: string}>
*/
private function formatAddresses(array
$addresses): array
{ $formattedAddresses =
[];
foreach ($addresses as $address) { $formattedAddresses[] =
$this->
formatAddress($address);
} return $formattedAddresses;
} private function getPayload(Email
$email, Envelope
$envelope): array
{ $payload =
[ 'sender' =>
$this->
formatAddress($envelope->
getSender()),
'to' =>
$this->
formatAddresses($this->
getRecipients($email,
$envelope)),
'subject' =>
$email->
getSubject(),
];