Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to manually resend email verification in Laravel?

I have an admin page on my site and I want an option to be able to manually resend an email verification, there are two purposes for this:

  1. Test email verifications templates.
  2. Debug user issues.

Does the user model have a method to do this?

like image 281
Elliott Coe Avatar asked Apr 16 '19 21:04

Elliott Coe


People also ask

How do I change the verification email in Laravel?

Laravel provides an option to modify the verification email content. In App\Providers\AuthServiceProvider need to call toMailUsing the method from the boot method. * Register any authentication / authorization services. ->line('Click the button below to verify your email address.

How do I send verification email after registering in Laravel?

Model Preparation As you can see by examining your application's App\Providers\EventServiceProvider , Laravel already contains a SendEmailVerificationNotification listener that is attached to the Illuminate\Auth\Events\Registered event. This event listener will send the email verification link to the user.


1 Answers

If your User model implements the MustVerifyEmail interface, yes, you can manually send the notification using:

$user->sendEmailVerificationNotification();
like image 123
nakov Avatar answered Oct 11 '22 03:10

nakov