$sentMessage->
setMessageId($result['id'
]);
return $response;
} private function getPayload(Email
$email, Envelope
$envelope): array
{ $payload =
[ 'from' =>
$envelope->
getSender()->
toString(),
'to' =>
implode(',',
$this->
stringifyAddresses($this->
getRecipients($email,
$envelope))),
'cc' =>
implode(',',
$this->
stringifyAddresses($email->
getCc())),
'bcc' =>
implode(',',
$this->
stringifyAddresses($email->
getBcc())),
'replyto' =>
implode(',',
$this->
stringifyAddresses($email->
getReplyTo())),
'subject' =>
$email->
getSubject(),
'textbody' =>
$email->
getTextBody(),
'htmlbody' =>
$email->
getHtmlBody(),
'attachments' =>
$this->
getAttachments($email),
'tags' =>
[],
];
$headersToBypass =
['from', 'to', 'cc', 'bcc', 'subject', 'content-type', 'sender', 'reply-to'
];