Skip to content
Snippets Groups Projects
Commit ddf5a859 authored by Pierre Fleutot's avatar Pierre Fleutot
Browse files

Merge branch 'dev_pierre' into master-no-group

# Conflicts:
#	templates/user/showProfile.html.twig
parents 234d92d1 ab5c370a
No related branches found
No related tags found
No related merge requests found
...@@ -13,8 +13,10 @@ use Symfony\Component\HttpFoundation\Request; ...@@ -13,8 +13,10 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address; use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use SymfonyCasts\Bundle\ResetPassword\Controller\ResetPasswordControllerTrait; use SymfonyCasts\Bundle\ResetPassword\Controller\ResetPasswordControllerTrait;
use SymfonyCasts\Bundle\ResetPassword\Exception\ResetPasswordExceptionInterface; use SymfonyCasts\Bundle\ResetPassword\Exception\ResetPasswordExceptionInterface;
...@@ -164,15 +166,15 @@ class ResetPasswordController extends AbstractController ...@@ -164,15 +166,15 @@ class ResetPasswordController extends AbstractController
return $this->redirectToRoute('app_check_email'); return $this->redirectToRoute('app_check_email');
} }
$email = (new TemplatedEmail()) $url = $this->generateUrl('app_reset_password', ['token' => $resetToken->getToken()], UrlGeneratorInterface::ABSOLUTE_URL);
->from(new Address('no-reply@balex.fr', 'Base Balex')) $link = sprintf('<a href="%s">%s</a>', $url, $url);
$email = (new Email())
->from($_ENV['MAILER_FROM'])
->to($user->getEmail()) ->to($user->getEmail())
->subject('Réinitialisation de votre mot de passe') ->subject('Réinitialisation de votre mot de passe')
->htmlTemplate('reset_password/email.html.twig') ->html('<h1>Bonjour</h1>
->context([ <p>Pour réinitialiser votre mot de passe, veuillez cliquer sur le lien suivant:</p>' . $link);
'resetToken' => $resetToken,
])
;
$mailer->send($email); $mailer->send($email);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment