Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit2db187a

Browse files
committed
drop the Date header using the Postmark API transport
1 parentc5d39dd commit2db187a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

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

Lines 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+
publicfunctiontestBypassHeaders()
73+
{
74+
$email = (newEmail())->date(new \DateTimeImmutable());
75+
$envelope =newEnvelope(newAddress('alice@system.com'), [newAddress('bob@system.com')]);
76+
77+
$transport =newPostmarkApiTransport('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
publicfunctiontestSend()
7385
{
7486
$client =newMockHttpClient(function (string$method,string$url,array$options):ResponseInterface {

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

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp