🎨 Ajoute le mail d'accueil
This commit is contained in:
34
app/Listeners/SendWelcomeNotification.php
Normal file
34
app/Listeners/SendWelcomeNotification.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners;
|
||||
|
||||
use App\Jobs\SendWelcomeEmail;
|
||||
use App\User;
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class SendWelcomeNotification
|
||||
{
|
||||
/**
|
||||
* Create the event listener.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param \Illuminate\Auth\Events\Registered $event
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Registered $event)
|
||||
{
|
||||
$emailJob = (new SendWelcomeEmail($event->user))->delay(Carbon::now()->addSeconds(3));
|
||||
dispatch($emailJob);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user