1
0
Fork 0
mirror of synced 2024-10-01 17:58:02 +13:00

fix redis issue by encoding content

This commit is contained in:
Damodar Lohani 2023-12-08 21:34:39 +00:00
parent f553576d0e
commit e3bab623f1
2 changed files with 3 additions and 2 deletions

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

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'