diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index f1372766..1111c965 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -193,11 +193,11 @@ class AuthController extends Controller $url = Option::get('site_url')."/auth/reset?uid=$uid&token=$token"; try { - Mail::send('auth.mail', ['reset_url' => $url], function ($m) use ($request) { + Mail::send('mails.password-reset', compact('url'), function ($m) use ($request) { $site_name = option_localized('site_name'); $m->from(config('mail.username'), $site_name); - $m->to($request->input('email'))->subject(trans('auth.mail.title', ['sitename' => $site_name])); + $m->to($request->input('email'))->subject(trans('auth.forgot.mail.title', ['sitename' => $site_name])); }); Log::info("[Password Reset] Mail has been sent to [{$request->input('email')}] with token [$token]"); @@ -205,12 +205,12 @@ class AuthController extends Controller // Write the exception to log report($e); - return json(trans('auth.mail.failed', ['msg' => $e->getMessage()]), 2); + return json(trans('auth.forgot.failed', ['msg' => $e->getMessage()]), 2); } Session::put('last_mail_time', time()); - return json(trans('auth.mail.success'), 0); + return json(trans('auth.forgot.success'), 0); } public function reset(UserRepository $users, Request $request) diff --git a/resources/lang/en/auth.yml b/resources/lang/en/auth.yml index 9197804b..c70499ab 100644 --- a/resources/lang/en/auth.yml +++ b/resources/lang/en/auth.yml @@ -30,15 +30,13 @@ forgot: close: Password resetting is not available now. frequent-mail: You click the send button too fast. Wait for 60 secs, guy. unregistered: The email address is not registered. - -mail: - title: Reset your password on :sitename - success: Mail is sent. Will be expired in 1 hour, please check. + success: Mail sent, please check your inbox. The link will be expired in 1 hour. failed: Fail to send mail, detailed message :msg - message: You are receiving this email because this email address was used to reset your password on :sitename - ignore: If you haven't signed up on our site, please ignore this email. No unsubscribing is required. - reset: Reset your password - notice: This mail is sending automatically, no reponses will be sent if you reply. + mail: + title: Reset your password on :sitename + message: You are receiving this email because we received a password reset request for your account on :sitename. + reset: "To reset your password, please visit: :url" + ignore: If you did not request a password reset, no further action is required. reset: title: Reset Password diff --git a/resources/lang/zh_CN/auth.yml b/resources/lang/zh_CN/auth.yml index edd61186..75c33d69 100644 --- a/resources/lang/zh_CN/auth.yml +++ b/resources/lang/zh_CN/auth.yml @@ -30,15 +30,13 @@ forgot: close: 本站已关闭重置密码功能 frequent-mail: 你邮件发送得太频繁啦,过 60 秒后再点发送吧 unregistered: 该邮箱尚未注册 - -mail: - title: 重置您在 :sitename 上的账户密码 success: 邮件已发送,一小时内有效,请注意查收。 failed: 邮件发送失败,详细信息::msg - message: 您收到这封邮件,是因为在 :sitename 的用户重置密码功能使用了您的地址。 - ignore: 如果您并没有访问过我们的网站,或没有进行上述操作,请忽略这封邮件。 您不需要退订或进行其他进一步的操作。 - reset: 重置密码 - notice: 本邮件由系统自动发送,就算你回复了我们也不会回复你哦 + mail: + title: 重置您在 :sitename 上的账户密码 + message: 您收到这封邮件,是因为有人在 :sitename 的密码重置功能中使用了您的地址。 + reset: 点击此链接重置您的密码::url + ignore: 如果您并没有访问过我们的网站,或没有进行上述操作,请忽略这封邮件。 reset: title: 重置密码 diff --git a/resources/views/auth/mail.tpl b/resources/views/auth/mail.tpl deleted file mode 100644 index e12cca5a..00000000 --- a/resources/views/auth/mail.tpl +++ /dev/null @@ -1,26 +0,0 @@ -
{!! trans('auth.forgot.mail.message', ['sitename' => option_localized('site_name')]) !!}
+{!! trans('auth.forgot.mail.reset', ['url' => $url]) !!}
+{!! trans('auth.forgot.mail.ignore') !!}