src/Controller/Front/BecomeAFounderController.php line 18
<?phpnamespace App\Controller\Front;use App\Entity\Front\Contact;use App\Form\Front\ContactType;use App\Repository\Front\ContactRepository;use Symfony\Bridge\Twig\Mime\TemplatedEmail;use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;use Symfony\Component\HttpFoundation\Request;use Symfony\Component\HttpFoundation\Response;use Symfony\Component\Mailer\MailerInterface;use Symfony\Component\Routing\Annotation\Route;class BecomeAFounderController extends AbstractController{#[Route('/become-a-founder', name: 'app_front_become_a_founder')]public function index(Request $request,ContactRepository $contactRepository,MailerInterface $mailer): Response {$contact = new Contact();$form = $this->createForm(ContactType::class, $contact);$form->handleRequest($request);if ($form->isSubmitted() && $form->isValid()) {$contact->setCreatedAt(new \DateTimeImmutable());$contact->setSource('app_front_become_a_founder');$contactRepository->save($contact, true);$email = (new TemplatedEmail())->to('notgoingtospam@founders-agency.com')->from($contact->getEmail())->subject('Consulta desde el sitio web')->htmlTemplate('front/contact/mail_template.html.twig')->context(['contact' => $contact]);$mailer->send($email);return $this->redirectToRoute('app_front_become_a_founder_thankyou');}return $this->render('front/become_a_founder/index.html.twig', ['controller_name' => 'BecomeAFounderController','form' => $form->createView(),]);}#[Route('/become-a-founder-thankyou', name: 'app_front_become_a_founder_thankyou', methods:["GET"])]public function thankyou(): Response{return $this->render('front/become_a_founder/thankyou.html.twig', ['controller_name' => 'ContactController',]);}}