public function sendEmailConfirmation($userToken)
    {
        /** @var Mailer $mailer */
        /** @var Message $message */

        // modify view path to module views
        $mailer = Yii::$app->mailer;
        $oldViewPath = $mailer->viewPath;
        $mailer->viewPath = $this->module->emailViewPath;

        // send email
        $user = $this;
        $profile = $user->profile;
        $email = $userToken->data ?: $user->email;
        $subject = Yii::$app->id . " - " . Yii::t("user", "Email Confirmation");
        $result = $mailer->compose('confirmEmail', compact("subject", "user", "profile", "userToken"))
            ->setTo($email)
            ->setSubject($subject)
            ->send();

        // restore view path and return result
        $mailer->viewPath = $oldViewPath;
        return $result;
    }
public function sendEmailConfirmation($userToken)
    {
        /** @var Mailer $mailer */
        /** @var Message $message */

        // modify view path to module views
        $mailer = Yii::$app->mailer;
        $oldViewPath = $mailer->viewPath;
        $mailer->viewPath = $this->module->emailViewPath;

        // send email
        $user = $this;
        $profile = $user->profile;
        $email = $userToken->data ?: $user->email;
        $subject = Yii::$app->id . " - " . Yii::t("user", "Email Confirmation");
        $result = $mailer->compose('confirmEmail', compact("subject", "user", "profile", "userToken"))
            ->setTo($email)
            ->setSubject($subject)
            ->send();

        // restore view path and return result
        $mailer->viewPath = $oldViewPath;
        return $result;
    }
public function sendEmailConfirmation ( $ userToken ) { /** @var Mailer $mailer */ /** @var Message $message */ // modify view path to module views $ mailer = Yii :: $ app -> mailer ; $ oldViewPath = $ mailer -> viewPath ; $ mailer -> viewPath = $ this -> module -> emailViewPath ; // send email $ user = $ this ; $ profile = $ user -> profile ; $ email = $ userToken -> data ? : $ user -> email ; $ subject = Yii :: $ app -> id . " - " . Yii :: t ( "user" , "Email Confirmation" ) ; $ result = $ mailer -> compose ( 'confirmEmail' , compact ( "subject" , "user" , "profile" , "userToken" ) ) -> setTo ( $ email ) -> setSubject ( $ subject ) -> send ( ) ; // restore view path and return result $ mailer -> viewPath = $ oldViewPath ; return $ result ; }
Send email confirmation to user
@param UserToken $userToken
@return int
Send email confirmation to user