src/Controller/ResettingController.php line 28

Open in your IDE?
  1. <?php
  2. // src/Controller/RegistrationController.php
  3. namespace App\Controller;
  4. use App\Entity\AppUser;
  5. use App\Form\RegistrationFormType;
  6. use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
  7. use Symfony\Component\HttpFoundation\Response;
  8. use Symfony\Component\HttpFoundation\Session\SessionInterface;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\Mailer\MailerInterface;
  13. use Symfony\Component\Mime\Email;
  14. /**
  15.  * @Route("/{_locale}/resetting")
  16.  */
  17. class ResettingController extends AbstractController
  18. {
  19.     
  20.     /**
  21.      * @Route("/request", name="resetting.request")
  22.      * @return \Symfony\Component\HttpFoundation\Response
  23.     */
  24.     public function request(Request $requestUserPasswordHasherInterface $passwordHasherMailerInterface $mailer)
  25.     {
  26.        $email = (new Email())
  27.         ->from('hello@example.com')
  28.         ->to('you@example.com')
  29.         ->subject('Time for Symfony Mailer!')
  30.         ->text('Sending emails is fun again!')
  31.         ->html('<p>See Twig integration!</p>');
  32.     $mailer->send($email); // Dispatches the message
  33.         
  34.         if($request->getMethod() == 'POST'){
  35.             
  36.         }
  37.         
  38.         return $this->render('resetting/request.html.twig', [ 
  39.         ]);
  40.     }
  41. }