Merge pull request #7262 from appwrite/feat-mail-worker-attachment-support

fix redis issue by encoding content
This commit is contained in:
Damodar Lohani
2023-12-08 22:44:38 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -317,11 +317,12 @@ class Mail extends Event
public function setAttachment(string $content, string $filename, string $encoding = 'base64', string $type = 'plain/text')
{
$this->attachment = [
'content' => $content,
'content' => base64_encode($content),
'filename' => $filename,
'encoding' => $encoding,
'type' => $type,
];
return $this;
}
public function getAttachment(): array
+1 -1
View File
@@ -92,7 +92,7 @@ class Mails extends Action
$mail->AltBody = \strip_tags($body);
if (!empty($attachment['content'] ?? '')) {
$mail->AddStringAttachment(
$attachment['content'],
base64_decode($attachment['content']),
$attachment['filename'] ?? 'unknown.file',
$attachment['encoding'] ?? PHPMailer::ENCODING_BASE64,
$attachment['type'] ?? 'plain/text'