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

[Mailer] Fix attachments and embedded images for Mailchimp API #33996

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Fail 8000 ed 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