Skip to content

Commit

Permalink
message id
Browse files Browse the repository at this point in the history
  • Loading branch information
hafael committed Jan 19, 2023
1 parent 84c2c71 commit 5361737
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/AzureMailerTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Mail\Transport\Transport;
use Swift_Mime_SimpleMessage;
use Swift_Attachment;
use Illuminate\Support\Str;

class AzureMailerTransport extends Transport
{
Expand Down Expand Up @@ -199,11 +200,13 @@ protected function getHeaders($request, Swift_Mime_SimpleMessage $message)

// Add our final signature in Base64 to the authorization header of the request.
$headers['Authorization'] = "HMAC-SHA256 SignedHeaders=date;host;x-ms-content-sha256&Signature=" . $signature;

$messageId = str_replace('@swift.generated', '', $message->getId());

return array_merge($headers, [
'Content-Type' => 'application/json',
'x-ms-date' => $headers['Date'],
'repeatability-request-id' => str_replace('@swift.generated', '', $message->getId()),
'repeatability-request-id' => !empty($messageId) && Str::isUuid($messageId) ? $messageId : (string) Str::uuid(),
'repeatability-first-sent' => $headers['Date'],
'Host' => $hostStr,
]);
Expand Down

0 comments on commit 5361737

Please sign in to comment.