Fixes email template used in password reset service
This commit is contained in:
@@ -44,12 +44,16 @@ class PasswordResetService {
|
||||
return false;
|
||||
}
|
||||
|
||||
private function sendResetToken(PasswordResetToken $token, string $email): bool {
|
||||
private function sendResetToken(PasswordResetTokenInterface $token, string $email): bool {
|
||||
$url = $_SERVER['HTTP_HOST'];
|
||||
$body = file_get_contents(__DIR__ . '/../../templates/email/passwordResetToken.php');
|
||||
if (file_exists(__DIR__ . '/../../../../../' . config('password-reset-mail-template') . '.php')) {
|
||||
$body = file_get_contents(__DIR__ . '/../../../../../templates/email/passwordResetToken.php');
|
||||
}
|
||||
$search = ['{url}', '{token}'];
|
||||
$replace = [$_SERVER['HTTP_HOST'], $token->getToken()];
|
||||
$body = str_replace($search, $replace, $body);
|
||||
|
||||
return $this->mailer->send(config('password-reset-mail-from'), $email, config('password-reset-mail-subject'), $body, config('password-reset-mail-headers'));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h2>Password reset link</h2>
|
||||
<p>By clicking the following link you can set new password for <?php echo $url; ?>:</p>
|
||||
<p><a href="<?php echo $url; ?>/password/set?token=<?php echo $token; ?>"><?php echo $url; ?>/password/set?token=<?php echo $token; ?></a></p>
|
||||
<p>By clicking the following link you can set new password for {url}:</p>
|
||||
<p><a href="{url}/password/set?token={token}">{url}/password/set?token={token}</a></p>
|
||||
<p>Regards,<br>
|
||||
<?php echo $url; ?> Admin</p>
|
||||
{url} Administrator</p>
|
||||
Reference in New Issue
Block a user