bundle/Controller/UserController.php
public function activationForm(Request $request): Response
    {
        $form = $this->createActivationForm();
        $form->handleRequest($request);

        if (!$form->isValid()) {
            return $this->render(
                $this->getConfigResolver()->getParameter('template.user.activate', 'ngsite'),
                [
                    'form' => $form->createView(),
                ]
            );
        }

        $users = $this->userService->loadUsersByEmail($form->get('email')->getData());

        $activationRequestEvent = new UserEvents\ActivationRequestEvent(
            $form->get('email')->getData(),
            $users[0] ?? null
        );

        $this->eventDispatcher->dispatch(SiteEvents::USER_ACTIVATION_REQUEST, $activationRequestEvent);

        return $this->render(
            $this->getConfigResolver()->getParameter('template.user.activate_sent', 'ngsite')
        );
    }
public function activationForm(Request $request): Response
    {
        $form = $this->createActivationForm();
        $form->handleRequest($request);

        if (!$form->isValid()) {
            return $this->render(
                $this->getConfigResolver()->getParameter('template.user.activate', 'ngsite'),
                [
                    'form' => $form->createView(),
                ]
            );
        }

        $users = $this->userService->loadUsersByEmail($form->get('email')->getData());

        $activationRequestEvent = new UserEvents\ActivationRequestEvent(
            $form->get('email')->getData(),
            $users[0] ?? null
        );

        $this->eventDispatcher->dispatch(SiteEvents::USER_ACTIVATION_REQUEST, $activationRequestEvent);

        return $this->render(
            $this->getConfigResolver()->getParameter('template.user.activate_sent', 'ngsite')
        );
    }
public function activationForm ( Request $ request ) : Response { $ form = $ this -> createActivationForm ( ) ; $ form -> handleRequest ( $ request ) ; if ( ! $ form -> isValid ( ) ) { return $ this -> render ( $ this -> getConfigResolver ( ) -> getParameter ( 'template.user.activate' , 'ngsite' ) , [ 'form' => $ form -> createView ( ) , ] ) ; } $ users = $ this -> userService -> loadUsersByEmail ( $ form -> get ( 'email' ) -> getData ( ) ) ; $ activationRequestEvent = new UserEvents \ ActivationRequestEvent ( $ form -> get ( 'email' ) -> getData ( ) , $ users [ 0 ] ?? null ) ; $ this -> eventDispatcher -> dispatch ( SiteEvents :: USER_ACTIVATION_REQUEST , $ activationRequestEvent ) ; return $ this -> render ( $ this -> getConfigResolver ( ) -> getParameter ( 'template.user.activate_sent' , 'ngsite' ) ) ; }
Displays and validates the form for sending an activation mail.
Displays and validates the form for sending an activation mail .