8000 bug #37900 [Mailer] Fixed mandrill api header structure (wulff) · dunglas/symfony@1f4c616 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1f4c616

Browse files
committed
bug symfony#37900 [Mailer] Fixed mandrill api header structure (wulff)
This PR was submitted for the 5.1 branch but it was squashed and merged into the 4.4 branch instead. Discussion ---------- [Mailer] Fixed mandrill api header structure | Q | A | ------------- | --- | Branch? | 5.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT When using the Mandrill API transport, it is not possible to set a reply-to address. **How to reproduce** Create a new email and add a reply-to address: ```php $email = (new Email()) ->from('from@example.com') ->to('to@example.com') ->replyTo('replyto@example.com') ->subject('subject') ->text('text'); $mailer->send($email); ``` The expected result is a payload which contains the following headers: ``` "headers": { "reply-to": "replyto@example.com" } ``` But instead, the `getPayload()` method produces these headers: ``` "headers": [ "reply-to: replyto@example.com" ] ``` **Additional context** See https://mandrillapp.com/api/docs/messages.html. Commits ------- aeb4c5e [Mailer] Fixed mandrill api header structure
2 parents f1437be + aeb4c5e commit 1f4c616

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function testCustomHeader()
6363
$this->assertArrayHasKey('message', $payload);
6464
$this->assertArrayHasKey('headers', $payload['message']);
6565
$this->assertCount(1, $payload['message']['headers']);
66-
$this->assertEquals('foo: bar', $payload['message']['headers'][0]);
66+
$this->assertEquals('bar', $payload['message']['headers']['foo']);
6767
}
6868

6969
public function testSend()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private function getPayload(Email $email, Envelope $envelope): array
111111
continue;
112112
}
113113

114-
$payload['message']['headers'][] = $name.': '.$header->getBodyAsString();
114+
$payload['message']['headers'][$name] = $header->getBodyAsString();
115115
}
116116

117117
return $payload;

0 commit comments

Comments
 (0)
0