src/Controller/AdminResettingController.php
private function sendResettingEmailMessage(UserInterface $user): void
    {
        $url = $this->generateUrl('networking_init_cms_admin_resetting_reset', [
            'token' => $user->getConfirmationToken(),
        ], UrlGeneratorInterface::ABSOLUTE_URL);

        $rendered = $this->renderView($this->container->getParameter('fos_user.resetting.email.template'), [
            'user' => $user,
            'confirmationUrl' => $url,
        ]);

        // Render the email, use the first line as the subject, and the rest as the body
        $renderedLines = explode(PHP_EOL, trim($rendered));
        $subject = array_shift($renderedLines);
        $body = implode(PHP_EOL, $renderedLines);
        $message = (new \Swift_Message())
            ->setSubject($subject)
            ->setFrom($this->container->getParameter('fos_user.resetting.email.from_email'))
            ->setTo((string) $user->getEmail())
            ->setBody($body);
        $this->get('mailer')->send($message);
    }
private function sendResettingEmailMessage(UserInterface $user): void
    {
        $url = $this->generateUrl('networking_init_cms_admin_resetting_reset', [
            'token' => $user->getConfirmationToken(),
        ], UrlGeneratorInterface::ABSOLUTE_URL);

        $rendered = $this->renderView($this->container->getParameter('fos_user.resetting.email.template'), [
            'user' => $user,
            'confirmationUrl' => $url,
        ]);

        // Render the email, use the first line as the subject, and the rest as the body
        $renderedLines = explode(PHP_EOL, trim($rendered));
        $subject = array_shift($renderedLines);
        $body = implode(PHP_EOL, $renderedLines);
        $message = (new \Swift_Message())
            ->setSubject($subject)
            ->setFrom($this->container->getParameter('fos_user.resetting.email.from_email'))
            ->setTo((string) $user->getEmail())
            ->setBody($body);
        $this->get('mailer')->send($message);
    }
private function sendResettingEmailMessage ( UserInterface $ user ) : void { $ url = $ this -> generateUrl ( 'networking_init_cms_admin_resetting_reset' , [ 'token' => $ user -> getConfirmationToken ( ) , ] , UrlGeneratorInterface :: ABSOLUTE_URL ) ; $ rendered = $ this -> renderView ( $ this -> container -> getParameter ( 'fos_user.resetting.email.template' ) , [ 'user' => $ user , 'confirmationUrl' => $ url , ] ) ; // Render the email, use the first line as the subject, and the rest as the body $ renderedLines = explode ( PHP_EOL , trim ( $ rendered ) ) ; $ subject = array_shift ( $ renderedLines ) ; $ body = implode ( PHP_EOL , $ renderedLines ) ; $ message = ( new \ Swift_Message ( ) ) -> setSubject ( $ subject ) -> setFrom ( $ this -> container -> getParameter ( 'fos_user.resetting.email.from_email' ) ) -> setTo ( ( string ) $ user -> getEmail ( ) ) -> setBody ( $ body ) ; $ this -> get ( 'mailer' ) -> send ( $ message ) ; }
Send an email to a user to confirm the password reset.

@param UserInterface $user
Send an email to a user to confirm the password reset .