Skip to content

Commit 3bcdeb9

Browse files
authored
Merge pull request #73 from Kobo-one/main
Fix: prevent headers being lost when attachments are added
2 parents 318d9c9 + 6dbb085 commit 3bcdeb9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Transport/ResendTransportFactory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ protected function doSend(SentMessage $message): void
4545
$attachments = [];
4646
if ($email->getAttachments()) {
4747
foreach ($email->getAttachments() as $attachment) {
48-
$headers = $attachment->getPreparedHeaders();
49-
$filename = $headers->getHeaderParameter('Content-Disposition', 'filename');
48+
$attachmentHeaders = $attachment->getPreparedHeaders();
49+
$filename = $attachmentHeaders->getHeaderParameter('Content-Disposition', 'filename');
5050

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

5757
$attachments[] = $item;

0 commit comments

Comments
 (0)