want to send welcomemail to new user laravel filament

716 Views Asked by At

I have a work management in laravel and filament I want to send mail if new customer registered by admin or by user so how do that I found some tutorial for user side but for admin side I'm not sure how to do that help me to resolve this

Find a method to send mail if a user created by admin in filament dashboard

1

There are 1 best solutions below

0
On BEST ANSWER

The document said

There are several available hooks for the Create page:

The one that can help you send email or any other notifications is afterCreate().

Try creating a new Event using:

php artisan make:event AdminRegisteredEvent

Then create a new Listener using:

php artisan make:listener SendWelcomeEmailListener

Attach the listener to the event in EventServiceProvider.php.

After that call the event in afterCreate() method.