Skip to content

Commit

Permalink
Fix: prevent headers to be lost when attachments are added
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobo-one committed Jan 27, 2025
1 parent 318d9c9 commit 6dbb085
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Transport/ResendTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ protected function doSend(SentMessage $message): void
$attachments = [];
if ($email->getAttachments()) {
foreach ($email->getAttachments() as $attachment) {
$headers = $attachment->getPreparedHeaders();
$filename = $headers->getHeaderParameter('Content-Disposition', 'filename');
$attachmentHeaders = $attachment->getPreparedHeaders();
$filename = $attachmentHeaders->getHeaderParameter('Content-Disposition', 'filename');

$item = [
'content' => str_replace("\r\n", '', $attachment->bodyToString()),
'filename' => $filename,
'content_type' => $headers->get('Content-Type')->getBody(),
'content_type' => $attachmentHeaders->get('Content-Type')->getBody(),
];

$attachments[] = $item;
Expand Down

0 comments on commit 6dbb085

Please sign in to comment.