Skip to content

Commit

Permalink
Merge pull request #13 from mirko-codeplicity/master
Browse files Browse the repository at this point in the history
Added Feedback-ID header to MailerQ message
  • Loading branch information
ppavlovic committed Feb 4, 2021
2 parents 5dffe66 + 4a0e07f commit accc270
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Message/MailerQ/Rest/MessageFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class MessageFacade
{
const HEADER_MAILERQ_LOGID = 'x-nd-mailerlogid';
const HEADER_LIST_UNSUBSCRIBE = 'List-Unsubscribe';
const FEEDBACK_ID = 'Feedback-ID';

/**
* @param \G4\Mailer\Message $message
Expand Down Expand Up @@ -39,6 +40,12 @@ public static function convert(\G4\Mailer\Message $message, array $options)
$body['mime']['headers'][self::HEADER_LIST_UNSUBSCRIBE] = $message->getListUnsubscribe();
}

$messageHeaders = $message->getHeaders();

if (array_key_exists(self::FEEDBACK_ID, $messageHeaders)) {
$body['mime']['headers'][self::FEEDBACK_ID] = $messageHeaders[self::FEEDBACK_ID];
}

$headers = [
'Content-Type: application/json',
'Content-Length: ' . strlen(json_encode($body)),
Expand Down

0 comments on commit accc270

Please sign in to comment.