Skip to content

Commit 8243b65

Browse files
committed
bug #62333 Postal mailer transport message ID retrieval (lalcebo)
This PR was squashed before being merged into the 7.3 branch. Discussion ---------- Postal mailer transport message ID retrieval | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #60727 | License | MIT <!-- 🛠️ Replace this text with a concise explanation of your change: - What it does and why it's needed - A simple example of how it works (include PHP, YAML, etc.) - If it modifies existing behavior, include a before/after comparison Contributor guidelines: - ✅ Add tests and ensure they pass - 🐞 Bug fixes must target the **lowest maintained** branch where they apply https://symfony.com/releases#maintained-symfony-branches - ✨ New features and deprecations must target the **feature** branch and must add an entry to the changelog file of the patched component: https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - 🔒 Do not break backward compatibility: https://symfony.com/bc --> Commits ------- 2179ff6 Postal mailer transport message ID retrieval
2 parents a2b613e + 2179ff6 commit 8243b65

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Mailer/Bridge/Postal/Tests/Transport/PostalApiTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testSend()
6464
$this->assertSame(base64_encode('some attachment'), $body['attachments'][0]['data']);
6565
$this->assertSame('foo@bar.fr', $body['reply_to']);
6666

67-
return new JsonMockResponse(['message_id' => 'foobar'], [
67+
return new JsonMockResponse(['data' => ['message_id' => 'foobar']], [
6868
'http_code' => 200,
6969
]);
7070
});

src/Symfony/Component/Mailer/Bridge/Postal/Transport/PostalApiTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
6464
throw new HttpTransportException('Unable to send an email: '.$result['message'].\sprintf(' (code %d).', $statusCode), $response);
6565
}
6666

67-
$sentMessage->setMessageId($result['message_id']);
67+
$sentMessage->setMessageId($result['data']['message_id']);
6868

6969
return $response;
7070
}

0 commit comments

Comments
 (0)