讨论数量:
首先,在 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...)
推荐文章: