mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #7262 from appwrite/feat-mail-worker-attachment-support
fix redis issue by encoding content
This commit is contained in:
commit
3b7fa3d664
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')
|
public function setAttachment(string $content, string $filename, string $encoding = 'base64', string $type = 'plain/text')
|
||||||
{
|
{
|
||||||
$this->attachment = [
|
$this->attachment = [
|
||||||
'content' => $content,
|
'content' => base64_encode($content),
|
||||||
'filename' => $filename,
|
'filename' => $filename,
|
||||||
'encoding' => $encoding,
|
'encoding' => $encoding,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
];
|
];
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAttachment(): array
|
public function getAttachment(): array
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class Mails extends Action
|
||||||
$mail->AltBody = \strip_tags($body);
|
$mail->AltBody = \strip_tags($body);
|
||||||
if (!empty($attachment['content'] ?? '')) {
|
if (!empty($attachment['content'] ?? '')) {
|
||||||
$mail->AddStringAttachment(
|
$mail->AddStringAttachment(
|
||||||
$attachment['content'],
|
base64_decode($attachment['content']),
|
||||||
$attachment['filename'] ?? 'unknown.file',
|
$attachment['filename'] ?? 'unknown.file',
|
||||||
$attachment['encoding'] ?? PHPMailer::ENCODING_BASE64,
|
$attachment['encoding'] ?? PHPMailer::ENCODING_BASE64,
|
||||||
$attachment['type'] ?? 'plain/text'
|
$attachment['type'] ?? 'plain/text'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue