Skip to content

Commit bb46f8a

Browse files
committed
[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.
1 parent e3865b7 commit bb46f8a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Mailchimp/Http/Api/MandrillTransport.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ private function getPayload(Email $email, SmtpEnvelope $envelope): array
7979
'type' => $headers->get('Content-Type')->getBody(),
8080
];
8181

82+
if ($name = $headers->getHeaderParameter('Content-Disposition', 'name')) {
83+
$att['name'] = $name;
84+
}
85+
8286
if ('inline' === $disposition) {
83-
$payload['images'][] = $att;
87+
$payload['message']['images'][] = $att;
8488
} else {
85-
$payload['attachments'][] = $att;
89+
$payload['message']['attachments'][] = $att;
8690
}
8791
}
8892

0 commit comments

Comments
 (0)