Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 318cad4

Browse filesBrowse files
Roywcmtaylorotwell
andauthored
Add support for sending raw (non-encoded) attachments in Resend mail driver (#55803)
* Do not encode text/calendar mime types. * Update ResendTransport.php --------- Co-authored-by: Taylor Otwell <taylor@laravel.com>
1 parent b47abb5 commit 318cad4
Copy full SHA for 318cad4

File tree

Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-2
lines changed

‎src/Illuminate/Mail/Transport/ResendTransport.php

Copy file name to clipboardExpand all lines: src/Illuminate/Mail/Transport/ResendTransport.php
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,19 @@ protected function doSend(SentMessage $message): void
7272
if ($email->getAttachments()) {
7373
foreach ($email->getAttachments() as $attachment) {
7474
$attachmentHeaders = $attachment->getPreparedHeaders();
75+
$contentType = $attachmentHeaders->get('Content-Type')->getBody();
7576

7677
$filename = $attachmentHeaders->getHeaderParameter('Content-Disposition', 'filename');
7778

79+
if ($contentType == 'text/calendar') {
80+
$content = $attachment->getBody();
81+
} else {
82+
$content = str_replace("\r\n", '', $attachment->bodyToString());
83+
}
84+
7885
$item = [
79-
'content_type' => $attachmentHeaders->get('Content-Type')->getBody(),
80-
'content' => str_replace("\r\n", '', $attachment->bodyToString()),
86+
'content_type' => $contentType,
87+
'content' => $content,
8188
'filename' => $filename,
8289
];
8390

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.