php - Laravel 中更改密码重置邮件消息

标签 php laravel

我想翻译邮件中的消息。

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/

相关文章:

laravel - Composer 卡在 4.2 上的 "Resolving dependencies through SAT"

php - 为什么wpdb插入sql显示错误?

php - 使用 Eloquent 在选择查询中将外部元素传递到模型

php - Travis 自动加载器 PhpUnit

php - cakephp数据编辑和更新时如何从网站根目录中删除图像

laravel - Laravel DataTables 作为服务实现中表渲染后的排序问题

php - 编写预订代码(API)

javascript - 如何对checkbox、radio做checked? Javascript

php - 用于自定义脚本的 Wordpress RewriteRule

php - 如何在网站的网页之间传递信息