Newscoop\Services\EmailService::sendPasswordRestoreToken PHP Méthode

sendPasswordRestoreToken() public méthode

Send password restore token
public sendPasswordRestoreToken ( User $user ) : void | Exception
$user Newscoop\Entity\User
Résultat void | Exception
    public function sendPasswordRestoreToken(User $user)
    {
        $tokenService = $this->container->get('user.token');
        $publicationService = $this->container->get('newscoop_newscoop.publication_service');
        $templatesService = $this->container->get('newscoop.templates.service');
        $placeholdersService = $this->container->get('newscoop.placeholders.service');
        $preferencesService = $this->container->get('preferences');
        $smarty = $templatesService->getSmarty();
        $smarty->assign('user', new \MetaUser($user));
        $smarty->assign('token', $tokenService->generateToken($user, 'password.restore'));
        $smarty->assign('site', $publicationService->getPublicationAlias()->getName());
        $message = $templatesService->fetchTemplate("email_password-restore.tpl");
        $this->send($placeholdersService->get('subject'), $message, $user->getEmail(), $preferencesService->EmailFromAddress);
    }