Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e348513

Browse files
committed
bug #35173 [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API (vilius-g)
This PR was merged into the 4.3 branch. Discussion ---------- [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | 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 also adds previously missing attachment names. Commits ------- 7b1bbb6 [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
2 parents 08670cc + 7b1bbb6 commit e348513

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Symfony/Component/Mailer/Bridge/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)