Hey,
one way to do this:
First, to not send the verification e-mail you can remove the SendEmailVerificationNotification::class,
entry from the App\Providers\EventServiceProvider
class.
After that you can create a new listener eg. SendEmailConfirmationOnRoleAssignmentListener
and listen to the Laravel\Jetstream\Events\TeamMemberUpdated
event. In that listener you check if the user got the desired role assigned and if the user account isn't already confirmed.
If both is correct, you send the email verification using $user->sendEmailVerificationNotification();
.
Done!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community