Mailer/Mailer.php
public function sendSuccessfulLoginEmailMessage(UserInterface $user)
    {
        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
        $siteName  = $this->settingsManager->getParameter('general.site_name');
        $userName = sprintf('%s %s', $user->getFirstName(), $user->getLastName());

        $rendered = $this->templating->render(
            'EkynaUserBundle:Security:login_success_email.html.twig',
            [
                'username' => $userName,
                'sitename' => $siteName,
                'date' => new \DateTime()
            ]
        );

        $subject = $this->translator->trans(
            'ekyna_user.email.login_success.subject',
            ['%sitename%' => $siteName]
        );

        $this->sendEmail($rendered, $user->getEmail(), $userName, $subject);
    }
public function sendSuccessfulLoginEmailMessage(UserInterface $user)
    {
        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
        $siteName  = $this->settingsManager->getParameter('general.site_name');
        $userName = sprintf('%s %s', $user->getFirstName(), $user->getLastName());

        $rendered = $this->templating->render(
            'EkynaUserBundle:Security:login_success_email.html.twig',
            [
                'username' => $userName,
                'sitename' => $siteName,
                'date' => new \DateTime()
            ]
        );

        $subject = $this->translator->trans(
            'ekyna_user.email.login_success.subject',
            ['%sitename%' => $siteName]
        );

        $this->sendEmail($rendered, $user->getEmail(), $userName, $subject);
    }
public function sendSuccessfulLoginEmailMessage ( UserInterface $ user ) { /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */ $ siteName = $ this -> settingsManager -> getParameter ( 'general.site_name' ) ; $ userName = sprintf ( '%s %s' , $ user -> getFirstName ( ) , $ user -> getLastName ( ) ) ; $ rendered = $ this -> templating -> render ( 'EkynaUserBundle:Security:login_success_email.html.twig' , [ 'username' => $ userName , 'sitename' => $ siteName , 'date' => new \ DateTime ( ) ] ) ; $ subject = $ this -> translator -> trans ( 'ekyna_user.email.login_success.subject' , [ '%sitename%' => $ siteName ] ) ; $ this -> sendEmail ( $ rendered , $ user -> getEmail ( ) , $ userName , $ subject ) ; }
Sends an email to the user to warn about successful login.

@param UserInterface $user
Sends an email to the user to warn about successful login .