8000 [Mailer] Fix attachments and embedded images for Mailchimp API by michaelperrin · Pull Request #33996 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ private function getPayload(Email $email, SmtpEnvelope $envelope): array
$disposition = $headers->getHeaderBody('Content-Disposition');

$att = [
'name' => $attachment->getName(),
'content' => $attachment->bodyToString(),
'type' => $headers->get('Content-Type')->getBody(),
];

if ('inline' === $disposition) {
$payload['images'][] = $att;
$payload['message']['images'][] = $att;
} else {
$payload['attachments'][] = $att;
$payload['message']['attachments'][] = $att;
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/Mime/Part/TextPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public function getMediaSubtype(): string
return $this->subtype;
}

public function getName(): string
{
return $this->name;
}

/**
* @param string $disposition one of attachment, inline, or form-data
*
Expand Down
0