怎么更改邮箱收到的视图

怎么更改邮箱收到的视图

《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 2
5年前 评论
Adeljan (楼主) 5年前
Adeljan (楼主) 5年前

首先,在 User 模型中添加这样一个方法:

public function sendPasswordResetNotification($token)
{
    $this->notify(new ResetPasswordNotification($token));
}

然后自己添加一个 ResetPasswordNotification 通知,邮件通知

再然后,邮件的具体内容可以直接参考框架自带的,原来的邮件内容如下:

public function toMail($notifiable)
    {
        if (static::$toMailCallback) {
            return call_user_func(static::$toMailCallback, $notifiable, $this->token);
        }

        return (new MailMessage)
            ->subject(Lang::getFromJson('Reset Password Notification'))
            ->line(Lang::getFromJson('You are receiving this email because we received a password reset request for your account.'))
            ->action(Lang::getFromJson('Reset Password'), url(config('app.url').route('password.reset', ['token' => $this->token, 'email' => $notifiable->getEmailForPasswordReset()], false)))
            ->line(Lang::getFromJson('This password reset link will expire in :count minutes.', ['count' => config('auth.passwords.users.expire')]))
            ->line(Lang::getFromJson('If you did not request a password reset, no further action is required.'));
    }

也可以自己在发送邮件这里直接写一个邮件的类,具体参考 [邮件发送]。(https://learnku.com/index.php/docs/laravel...)

5年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!