bug #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
-------
aeb4c5e6c7
[Mailer] Fixed mandrill api header structure
This commit is contained in:
commit
1f4c61683e
@ -63,7 +63,7 @@ class MandrillApiTransportTest extends TestCase
|
||||
$this->assertArrayHasKey('message', $payload);
|
||||
$this->assertArrayHasKey('headers', $payload['message']);
|
||||
$this->assertCount(1, $payload['message']['headers']);
|
||||
$this->assertEquals('foo: bar', $payload['message']['headers'][0]);
|
||||
$this->assertEquals('bar', $payload['message']['headers']['foo']);
|
||||
}
|
||||
|
||||
public function testSend()
|
||||
|
@ -111,7 +111,7 @@ class MandrillApiTransport extends AbstractApiTransport
|
||||
continue;
|
||||
}
|
||||
|
||||
$payload['message']['headers'][] = $name.': '.$header->getBodyAsString();
|
||||
$payload['message']['headers'][$name] = $header->getBodyAsString();
|
||||
}
|
||||
|
||||
return $payload;
|
||||
|
Reference in New Issue
Block a user