8000 [Mailer] Fix attachments and embedded images for Mailchimp API · symfony/symfony@d8f544d · GitHub
[go: up one dir, main page]

Skip to content

Commit d8f544d

Browse files
committed
[Mailer] Fix attachments and embedded images for Mailchimp API
1 parent 0c77296 commit d8f544d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Symfony/Component/Mailer/Bridge/Mailchimp/Http/Api/MandrillTransport.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,15 @@ private function getPayload(Email $email, SmtpEnvelope $envelope): array
7070
$disposition = $headers->getHeaderBody('Content-Disposition');
7171

7272
$att = [
73+
'name' => $attachment->getName(),
7374
'content' => $attachment->bodyToString(),
7475
'type' => $headers->get('Content-Type')->getBody(),
7576
];
7677

7778
if ('inline' === $disposition) {
78-
$payload['images'][] = $att;
79+
$payload['message']['images'][] = $att;
7980
} else {
80-
$payload['attachments'][] = $att;
81+
$payload['message']['attachments'][] = $att;
8182
}
8283
}
8384

src/Symfony/Component/Mime/Part/TextPart.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ public function getMediaSubtype(): string
6969
return $this->subtype;
7070
}
7171

72+
public function getName(): string
73+
{
74+
return $this->name;
75+
}
76+
7277
/**
7378
* @param string $disposition one of attachment, inline, or form-data
7479
*

0 commit comments

Comments
 (0)
0