[Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API

Previous code tries to pass attachments to API, but uses incorrect structure and as a result all attachments are missing when the email is sent.
This commit is contained in:
Vilius Grigaliūnas 2020-01-02 17:40:32 +02:00
parent 3a51e0143a
commit 7b1bbb6190

View File

@ -79,10 +79,14 @@ class MandrillTransport extends AbstractApiTransport
'type' => $headers->get('Content-Type')->getBody(),
];
if ($name = $headers->getHeaderParameter('Content-Disposition', 'name')) {
$att['name'] = $name;
}
if ('inline' === $disposition) {
$payload['images'][] = $att;
$payload['message']['images'][] = $att;
} else {
$payload['attachments'][] = $att;
$payload['message']['attachments'][] = $att;
}
}