diff --git a/app/Notifications/TransactionalEmails/ResetPasswordEmail.php b/app/Notifications/TransactionalEmails/ResetPasswordEmail.php new file mode 100644 index 000000000..a23b64d47 --- /dev/null +++ b/app/Notifications/TransactionalEmails/ResetPasswordEmail.php @@ -0,0 +1,36 @@ +token = $token; + } + public function via() + { + return [TransactionalEmailChannel::class]; + } + + public function toMail(User $user): MailMessage + { + $url = url('/') . '/reset-password/' . $this->token . '?email=' . $user->email; + $mail = new MailMessage(); + $mail->subject('Reset Password'); + $mail->view('emails.reset-password', [ + 'user' => $user, + 'url' => $url, + ]); + return $mail; + } +} diff --git a/lang/en.json b/lang/en.json index 36c7b0283..6908255fd 100644 --- a/lang/en.json +++ b/lang/en.json @@ -3,7 +3,7 @@ "auth.already_registered": "Already registered?", "auth.confirm_password": "Confirm password", "auth.forgot_password": "Forgot password", - "auth.forgot_password_send_email": "Send password reset link via email", + "auth.forgot_password_send_email": "Send password reset email", "auth.register_now": "Register a new account", "auth.logout": "Logout", "auth.register": "Register", diff --git a/resources/views/auth/forgot-password.blade.php b/resources/views/auth/forgot-password.blade.php index 7caec854d..5be08eeec 100644 --- a/resources/views/auth/forgot-password.blade.php +++ b/resources/views/auth/forgot-password.blade.php @@ -10,19 +10,23 @@