src/Controller/DefaultController.php
/**
     * Emails are written for french people, translations are not required.
     *
     * @throws TransportExceptionInterface
     * @Route("/contact", name="contact", methods={"GET", "POST"})
     */
Emails are written for french people, translations are not required.
Emails are written for french people translations are not required .
public function contact(
        Request $request,
        PromoGendMailer $mailer,
        TranslatorInterface $translator
    ): Response {
        $form = $this->createForm(ContactType::class);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $mailer->send(
                'Mail de contact via le site.',
                'email/contact.html.twig',
                $form->getData(),
                Email::PRIORITY_HIGH
            );
            $this->addFlash(
                'info',
                $translator->trans('send.flash.success', ['%name%' => ucfirst($form->getData()['name'])], 'flashes')
            );
            return $this->redirectToRoute('app_index');
        }
        return $this->render('default/contact.html.twig', ['form' => $form->createView()]);
    }
public function contact ( Request $ request , PromoGendMailer $ mailer , TranslatorInterface $ translator ) : Response { $ form = $ this -> createForm ( ContactType :: class ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ mailer -> send ( 'Mail de contact via le site.' , 'email/contact.html.twig' , $ form -> getData ( ) , Email :: PRIORITY_HIGH ) ; $ this -> addFlash ( 'info' , $ translator -> trans ( 'send.flash.success' , [ '%name%' => ucfirst ( $ form -> getData ( ) [ 'name' ] ) ] , 'flashes' ) ) ; return $ this -> redirectToRoute ( 'app_index' ) ; } return $ this -> render ( 'default/contact.html.twig' , [ 'form' => $ form -> createView ( ) ] ) ; }
Emails are written for french people, translations are not required.
Emails are written for french people translations are not required .