【发布时间】:2018-02-06 09:20:51
【问题描述】:
当用户向他/她的电子邮件发送忘记密码重置链接时,我想让我的邮件更加详细。这是收到重置密码链接时的图片示例。
我想在这里添加一些细节,Hello 应该是 Hello! (此处为用户名)
这是我在 SendsPasswordResetEmails.php
中添加的代码public function sendResetLinkEmail(Request $request)
{
$this->validateEmail($request);
// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$request->only('email')
);
$applicant_name = Applicant::where('email', $request->email)->get()->value('name');
return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($response)
: $this->sendResetLinkFailedResponse($request, $response);
}
它应该将数据传递给 app\Notifications\ApplicantResetPasswordNotification.php
public function toMail($notifiable)
{
return (new MailMessage)
->from('vcc3dummy@gmail.com', 'CCV3')
->greeting('Hello! Applicant Name') // Applicant name pass here
->line('You are receiving this email because we received a password request for your account.')
->action('Click here to Reset Password', route('applicant.reset', $this->token))
->line('If you did not reset your password, no further action is required.');
}
寻求有关如何传递数据或如何查询数据的帮助。 如果有人可以帮助我,将不胜感激 提前致谢。
【问题讨论】:
-
您可以在调用时将其传递给
ApplicantResetPasswordNotification.php。你在哪里调用这个文件??
标签: php laravel email laravel-5 laravel-5.4