Update mail template of password reset

This commit is contained in:
printempw 2018-07-25 19:44:50 +08:00
parent 0c1537446f
commit 1490f202b3
5 changed files with 18 additions and 45 deletions

View File

@ -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)

View File

@ -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

View File

@ -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: 重置密码

View File

@ -1,26 +0,0 @@
<div style="background:#444;padding:0">
<link rel="stylesheet" type="text/css" href="https://work.prinzeugen.net/font/Minecraft.css">
<div style="min-height:100%;background:#444;padding:80px 0;margin:0;font-size:14px;line-height:1.7;font-family:'Helvetica Neue',Arial,'Microsoft Yahei','Microsoft Jhenghei',sans-serif;color:#444">
<center>
<div style="margin:0 auto;width:580px;background:#fff;text-align:left">
<h1 style="margin:0 40px;color:#999;border-bottom:1px dotted #ddd;padding:40px 0 30px;text-align:center;font-size: 35px;font-family:Minecraft,Copperplate,'Copperplate Gothic Light',Palatino,'Palatino Linotype','Palatino LT STD',Georgia,'Microsoft Yahei','Microsoft Jhenghei',serif">
{{ option_localized('site_name') }}
</h1>
<div style="padding:30px 40px 40px">{!! trans('auth.mail.message', ['sitename' => "<a style='color:#009a61;text-decoration:none' href='".option('site_url')."'>".option_localized('site_name')."</a>"]) !!}<br><br>
<div style="border-left:5px solid #ddd;padding:0 0 0 24px;color:#888">
{{ trans('auth.mail.ignore') }}
</div>
</div>
<div style="background:#eee;border-top:1px solid #ddd;text-align:center;min-height:90px;line-height:90px">
<a href="{{ $reset_url }}" style="padding:8px 18px;background:#009a61;color:#fff;text-decoration:none;border-radius:3px" target="_blank">
{{ trans('auth.mail.reset') }}
</a>
</div>
</div>
<div style="padding-top:30px;text-align:center;font-size:12px;color:#999">
* {{ trans('auth.mail.notice') }} <br>
</div>
</center>
</div>
<div style="min-height:100%;background:#444;padding:40px 0;margin:0;font-size:14px;line-height:1.7;font-family:'Helvetica Neue',Arial,'Microsoft Yahei','Microsoft Jhenghei',sans-serif;color:#444"></div>
</div>

View File

@ -0,0 +1,3 @@
<p>{!! trans('auth.forgot.mail.message', ['sitename' => option_localized('site_name')]) !!}</p>
<p>{!! trans('auth.forgot.mail.reset', ['url' => $url]) !!}</p>
<p>{!! trans('auth.forgot.mail.ignore') !!}</p>