我想翻译邮件中的消息。
vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php
public function toMail()
{
return (new MailMessage)
->line([
'You are receiving this email because we received a password reset request for your account.',
'Click the button below to reset your password:',
])
->action('Reset Password', url('password/reset', $this->token))
->line('If you did not request a password reset, no further action is required.');
}
更改消息的最佳方式是什么?很确定我不应该在这个文件中更改它..
最佳答案
来自5.3 docs :
You may easily modify the notification class used to send the password reset link to the user. To get started, override the
sendPasswordResetNotification
method on your User model. Within this method, you may send the notification using any notification class you choose. The password reset $token is the first argument received by the method:
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
希望这有帮助。
关于php - Laravel 中更改密码重置邮件消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40607376/