Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e4e6f31

Browse filesBrowse files
committed
bug #60256 [Mailer][Postmark] drop the Date header using the API transport (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Mailer][Postmark] drop the `Date` header using the API transport | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #60254 | License | MIT Commits ------- 2db187a drop the Date header using the Postmark API transport
2 parents c5d39dd + 2db187a commit e4e6f31
Copy full SHA for e4e6f31

File tree

2 files changed

+13
-1
lines changed
Filter options

2 files changed

+13
-1
lines changed

‎src/Symfony/Component/Mailer/Bridge/Postmark/Tests/Transport/PostmarkApiTransportTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Postmark/Tests/Transport/PostmarkApiTransportTest.php
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ public function testCustomHeader()
6969
$this->assertEquals(['Name' => 'foo', 'Value' => 'bar'], $payload['Headers'][0]);
7070
}
7171

72+
public function testBypassHeaders()
73+
{
74+
$email = (new Email())->date(new \DateTimeImmutable());
75+
$envelope = new Envelope(new Address('alice@system.com'), [new Address('bob@system.com')]);
76+
77+
$transport = new PostmarkApiTransport('ACCESS_KEY');
78+
$method = new \ReflectionMethod(PostmarkApiTransport::class, 'getPayload');
79+
$payload = $method->invoke($transport, $email, $envelope);
80+
81+
$this->assertArrayNotHasKey('Headers', $payload);
82+
}
83+
7284
public function testSend()
7385
{
7486
$client = new MockHttpClient(function (string $method, string $url, array $options): ResponseInterface {

‎src/Symfony/Component/Mailer/Bridge/Postmark/Transport/PostmarkApiTransport.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Postmark/Transport/PostmarkApiTransport.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private function getPayload(Email $email, Envelope $envelope): array
9191
'Attachments' => $this->getAttachments($email),
9292
];
9393

94-
$headersToBypass = ['from', 'to', 'cc', 'bcc', 'subject', 'content-type', 'sender', 'reply-to'];
94+
$headersToBypass = ['from', 'to', 'cc', 'bcc', 'subject', 'content-type', 'sender', 'reply-to', 'date'];
9595
foreach ($email->getHeaders()->all() as $name => $header) {
9696
if (\in_array($name, $headersToBypass, true)) {
9797
continue;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.