/** * Send an email to a user with an activation code. * * @param ActivatableInterface $user * @param string $code * * @return void * * @throws ActivationException */ protected function emailActivationCode(ActivatableInterface $user, $code) { $email = $user->getActivationEmail(); $method = $this->queue ? 'queue' : 'send'; $viewData = ['code' => $code, 'action' => 'anlutro\\Core\\Web\\AuthController@activate']; $this->mailer->{$method}('c::auth.activate-email', $viewData, function (Message $msg) use($email) { $msg->to($email)->subject($this->translator->get('c::auth.activate-title')); }); if (count($this->mailer->failures()) > 0) { throw new ActivationException('Could not send activation e-mail'); } }
/** * {@inheritdoc} */ public function deleteUser(ActivatableInterface $user) { return (bool) $this->newQuery()->where('email', '=', $user->getActivationEmail())->delete(); }