Skip to content

Commit e605799

Browse files
committed
ticket_36879 - Fix mandrill raw http request setting from email/name
1 parent 52ecda1 commit e605799

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

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('[email protected]', $body['from_email']);
6062
$this->assertSame('[email protected]', $body['to'][0]);
61-
$this->assertSame('Fabien <[email protected]>', $body['from_email']);
6263

6364
$this->assertStringContainsString('Subject: Hello!', $message);
6465
$this->assertStringContainsString('To: Saif Eddin <[email protected]>', $message);

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
]);

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
]);

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('[email protected]', $body['from_email']);
6062
$this->assertSame('[email protected]', $body['to'][0]);
61-
$this->assertSame('Fabien <[email protected]>', $body['from_email']);
6263

6364
$this->assertStringContainsString('Subject: Hello!', $message);
6465
$this->assertStringContainsString('To: Saif Eddin <[email protected]>', $message);

0 commit comments

Comments
 (0)