if ($email->
getReturnPath()) { $request['FeedbackForwardingEmailAddress'
] =
$email->
getReturnPath()->
toString();
} foreach ($email->
getHeaders()->
all() as $header) { if ($header instanceof MetadataHeader
) { $request['EmailTags'
][] =
['Name' =>
$header->
getKey(), 'Value' =>
$header->
getValue()];
} } return new SendEmailRequest($request);
} private function getRecipients(Email
$email, Envelope
$envelope): array
{ $emailRecipients =
array_merge($email->
getCc(),
$email->
getBcc());
return array_filter($envelope->
getRecipients(),
fn (Address
$address) => !\
in_array($address,
$emailRecipients, true
));
} protected function stringifyAddresses(array
$addresses): array
{