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

        if (0 === strlen($password)) {
            return 0;
        }

        if (null === $loginUrl = $this->getLoginUrl($user)) {
            return 0;
        }

        $rendered = $this->templating->render(
            'EkynaUserBundle:Admin/User:creation_email.html.twig',
            [
                'username'  => $userName,
                'sitename'  => $siteName,
                'login_url' => $loginUrl,
                'login'     => $login,
                'password'  => $password,
            ]
        );

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

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

        if (0 === strlen($password)) {
            return 0;
        }

        if (null === $loginUrl = $this->getLoginUrl($user)) {
            return 0;
        }

        $rendered = $this->templating->render(
            'EkynaUserBundle:Admin/User:creation_email.html.twig',
            [
                'username'  => $userName,
                'sitename'  => $siteName,
                'login_url' => $loginUrl,
                'login'     => $login,
                'password'  => $password,
            ]
        );

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

        return $this->sendEmail($rendered, $user->getEmail(), $userName, $subject);
    }
public function sendCreationEmailMessage ( UserInterface $ user , $ password ) { /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */ $ siteName = $ this -> settingsManager -> getParameter ( 'general.site_name' ) ; $ userName = sprintf ( '%s %s' , $ user -> getFirstName ( ) , $ user -> getLastName ( ) ) ; $ login = $ user -> getUsername ( ) ; if ( 0 === strlen ( $ password ) ) { return 0 ; } if ( null === $ loginUrl = $ this -> getLoginUrl ( $ user ) ) { return 0 ; } $ rendered = $ this -> templating -> render ( 'EkynaUserBundle:Admin/User:creation_email.html.twig' , [ 'username' => $ userName , 'sitename' => $ siteName , 'login_url' => $ loginUrl , 'login' => $ login , 'password' => $ password , ] ) ; $ subject = $ this -> translator -> trans ( 'ekyna_user.email.creation.subject' , [ '%sitename%' => $ siteName ] ) ; return $ this -> sendEmail ( $ rendered , $ user -> getEmail ( ) , $ userName , $ subject ) ; }
Sends an email to the user to warn about account creation.

@param UserInterface $user
@param string        $password
@return integer
Sends an email to the user to warn about account creation .