MAPG-69 make emails HTML explicitly

This commit is contained in:
bence committed 2020-06-14 20:52:42 +02:00
1 parent afbd0b4e20
commit 4ac18dfc84
2 files changed
+10 -11

No files matched your search

+2 -3
View File
@@ -27,7 +27,7 @@ class Mail
public function setBodyFromTemplate(string $template, array $params = []): void
{
$this->body = file_get_contents(ROOT . '/mail/' . $template . '.tpl');
$this->body = file_get_contents(ROOT . '/mail/' . $template . '.html');
foreach ($params as $key => $param) {
$this->body = str_replace('{{' . $key . '}}', $param, $this->body);
@@ -62,9 +62,8 @@ class Mail
$mailer->addReplyTo($_ENV['MAIL_FROM'], 'MapGuesser');
$mailer->Sender = !empty($_ENV['MAIL_BOUNCE']) ? $_ENV['MAIL_BOUNCE'] : $_ENV['MAIL_FROM'];
$mailer->Subject = $this->subject;
$mailer->Body = $this->body;
$mailer->msgHTML($this->body);
foreach ($this->recipients as $recipient) {
$this->sendMail($mailer, $recipient);