Newscoop\Services\EmailService::sendConfirmationToken PHP Method

sendConfirmationToken() public method

Send to user email confirmation token
public sendConfirmationToken ( User $user ) : void | Exception
$user Newscoop\Entity\User
return void | Exception
    public function sendConfirmationToken(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, 'email.confirm'));
        $smarty->assign('site', $publicationService->getPublicationAlias()->getName());
        $message = $templatesService->fetchTemplate("email_confirm.tpl");
        $this->send($placeholdersService->get('subject'), $message, $user->getEmail(), $preferencesService->EmailFromAddress);
    }