Skip to content

Commit 8308861

Browse files
committed
bug #36888 [Mailer] Fix mandrill raw http request setting from email/name (JohJohan)
This PR was merged into the 4.4 branch. Discussion ---------- [Mailer] Fix mandrill raw http request setting from email/name | Q | A | ------------- | --- | Branch? | 4.4, 5.0, 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #36879 | License | MIT | Doc PR | None As describe in #36879 there is a bug in sending raw http request to mandrill it will not set from email/name correct. As you can see i make sure to set `from_email` and `from_name` correct now and changed the unit test to check correct you can see the doc that the format is correct https://mandrillapp.com/api/docs/messages.curl.html#method-send-raw Commits ------- 6128dd0 ticket_36879 - Fix mandrill raw http request setting from email/name
2 parents fd13f5f + 6128dd0 commit 8308861

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Symfony/Component/Mailer/Bridge/Mailchimp/Tests/Transport/MandrillHttpTransportTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ public function testSend()
5757
$body = json_decode($options['body'], true);
5858
$message = $body['raw_message'];
5959
$this->assertSame('KEY', $body['key']);
60+
$this->assertSame('Fabien', $body['from_name']);
61+
$this->assertSame('fabpot@symfony.com', $body['from_email']);
6062
$this->assertSame('saif.gmati@symfony.com', $body['to'][0]);
61-
$this->assertSame('Fabien <fabpot@symfony.com>', $body['from_email']);
6263

6364
$this->assertStringContainsString('Subject: Hello!', $message);
6465
$this->assertStringContainsString('To: Saif Eddin <saif.gmati@symfony.com>', $message);

src/Symfony/Component/Mailer/Bridge/Mailchimp/Transport/MandrillHttpTransport.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ protected function doSendHttp(SentMessage $message): ResponseInterface
4949
'to' => array_map(function (Address $recipient): string {
5050
return $recipient->getAddress();
5151
}, $envelope->getRecipients()),
52-
'from_email' => $envelope->getSender()->toString(),
52+
'from_email' => $envelope->getSender()->getAddress(),
53+
'from_name' => $envelope->getSender()->getName(),
5354
'raw_message' => $message->toString(),
5455
],
5556
]);

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