diff --git a/src/Appwrite/Platform/Workers/Mails.php b/src/Appwrite/Platform/Workers/Mails.php index a29f2c6886..94a2a46087 100644 --- a/src/Appwrite/Platform/Workers/Mails.php +++ b/src/Appwrite/Platform/Workers/Mails.php @@ -62,13 +62,18 @@ class Mails extends Action $bodyTemplate = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-base.tpl'); $bodyTemplate->setParam('{{body}}', $body); - foreach ($variables as $key => $value) { $bodyTemplate->setParam('{{' . $key . '}}', $value); } - $body = $bodyTemplate->render(); + $subjectTemplate = Template::fromString($subject); + foreach ($variables as $key => $value) { + $subjectTemplate->setParam('{{' . $key . '}}', $value); + } + // render() will return the subject in
tags, so use strip_tags() to remove them + $subject = \strip_tags($subjectTemplate->render()); + /** @var PHPMailer $mail */ $mail = empty($smtp) ? $register->get('smtp')