Skip to content

Commit 0035d17

Browse files
committed
[Mailer] Revert changes for Mailgun HTTP transport type with custom "h:sender" header
1 parent 40df96f commit 0035d17

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

src/Symfony/Component/Mailer/Bridge/Mailgun/Tests/Transport/MailgunHttpTransportTest.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public function testSend()
6969
$this->assertStringContainsString('Subject: Hello!', $content);
7070
$this->assertStringContainsString('To: Saif Eddin <saif.gmati@symfony.com>', $content);
7171
$this->assertStringContainsString('From: Fabien <fabpot@symfony.com>', $content);
72-
$this->assertStringContainsString('Sender: Senior Fabien Eddin <fabpot@symfony.com>', $content);
73-
$this->assertStringContainsString('h:sender: "Senior Fabien Eddin" <fabpot@symfony.com>', $content);
7472
$this->assertStringContainsString('Hello There!', $content);
7573

7674
return new MockResponse(json_encode(['id' => 'foobar']), [
@@ -81,17 +79,11 @@ public function testSend()
8179
$transport->setPort(8984);
8280

8381
$mail = new Email();
84-
$toAddress = new Address('saif.gmati@symfony.com', 'Saif Eddin');
85-
$fromAddress = new Address('fabpot@symfony.com', 'Fabien');
86-
$senderAddress = new Address('fabpot@symfony.com', 'Senior Fabien Eddin');
8782
$mail->subject('Hello!')
88-
->to($toAddress)
89-
->from($fromAddress)
90-
->sender($senderAddress)
83+
->to(new Address('saif.gmati@symfony.com', 'Saif Eddin'))
84+
->from(new Address('fabpot@symfony.com', 'Fabien'))
9185
->text('Hello There!');
9286

93-
$mail->getHeaders()->addHeader('h:sender', $mail->getSender()->toString());
94-
9587
$message = $transport->send($mail);
9688

9789
$this->assertSame('foobar', $message->getMessageId());

src/Symfony/Component/Mailer/Bridge/Mailgun/Transport/MailgunHttpTransport.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public function __toString(): string
5353
protected function doSendHttp(SentMessage $message): ResponseInterface
5454
{
5555
$body = new FormDataPart([
56-
'h:sender' => $message->getEnvelope()->getSender()->toString(),
5756
'to' => implode(',', $this->stringifyAddresses($message->getEnvelope()->getRecipients())),
5857
'message' => new DataPart($message->toString(), 'message.mime'),
5958
]);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy