MAPG-69 make emails HTML explicitly

This commit is contained in:
Bence Pőcze 2020-06-14 20:52:42 +02:00
parent afbd0b4e20
commit 4ac18dfc84
2 changed files with 10 additions and 11 deletions

View File

@ -1,13 +1,13 @@
Hi,
You recently signed up on MapGuesser with this email address ({{EMAIL}}). To activate your account, please click on the following link:
<br><br>
You recently signed up on MapGuesser with this email address ({{EMAIL}}). To activate your account, please click on the following link:<br>
<a href="{{ACTIVATE_LINK}}" title="Account activation">{{ACTIVATE_LINK}}</a>
If you did not sign up on MapGuesser or changed your mind, no further action is required, your email address will be deleted soon.
However if you want to immediately delete it, please click on the following link:
<br><br>
If you did not sign up on MapGuesser or changed your mind, no further action is required, your email address will be deleted soon.<br>
However if you want to immediately delete it, please click on the following link:<br>
<a href="{{CANCEL_LINK}}" title="Sign up cancellation">{{CANCEL_LINK}}</a>
<br><br>
Have fun on MapGuesser!
Regards,
<br><br>
Regards,<br>
MapGuesser

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);