laravel 如何在多重身份验证系统中自定义密码重置电子邮件
how to customize the password reset email in a multiauth system in laravel
Objective:
我的应用程序中有 4 种类型的用户。
我正在尝试向不同类型的用户发送不同的电子邮件密码重置。
问题:
有什么办法可以用 Mailto 函数做到这一点吗?
您必须创建四个不同的通知。
使用 artisan 命令创建通知:
php artisan make:notification MailResetPasswordNotification
您会在目录 App\Notifications\MailResetPasswordNotification
中找到这些
为每个模型自定义您的电子邮件正文。
并在各自的模型中覆盖此方法
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPassword($token));
}
Objective:
我的应用程序中有 4 种类型的用户。
我正在尝试向不同类型的用户发送不同的电子邮件密码重置。
问题:
有什么办法可以用 Mailto 函数做到这一点吗?
您必须创建四个不同的通知。
使用 artisan 命令创建通知:
php artisan make:notification MailResetPasswordNotification
您会在目录 App\Notifications\MailResetPasswordNotification
中找到这些为每个模型自定义您的电子邮件正文。
并在各自的模型中覆盖此方法
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPassword($token));
}