fix redis issue by encoding content
This commit is contained in:
parent
f553576d0e
commit
e3bab623f1
2 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue