How Customize the email template for forgot password in laravel 11

Laravel comes with a default forgot password feature as part of its built-in authentication system, which is powered by Laravel Breeze, Laravel Jetstream, or Laravel Fortify depending on the setup .

But if you want to change the style of the existing email to a custom one you can follow these steps.

  • Open Your PasswordResetLink controller in auth folder. There you can see a method  Password::sendResetLink() . we can do additional codes to this.

  • Replace the above code with following
  • In the above code you can see $token is available
  • Create a notification class called CustomResetPasswordNotification
  • pass the token url($resetUrl ) and the email to the notification class. there you can write the email functionality.
  • If you need source code for this , do a comment for this post.

you can write like this below for sending the email: (I am just pasting the toMail method only.)

Thanks for reading my Post

Leave a Reply

Your email address will not be published. Required fields are marked *