create a mail when an event is deleted to the participants
This commit is contained in:
@@ -3,12 +3,15 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Events\EventParticipationCancelled;
|
||||
use App\Mail\EventParticipationCancelledMail;
|
||||
use App\Mail\ValidateMail;
|
||||
use App\Models\Events;
|
||||
use App\Models\Task;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
|
||||
class EventsController extends Controller
|
||||
@@ -100,6 +103,14 @@ class EventsController extends Controller
|
||||
$user->id,
|
||||
$event
|
||||
));
|
||||
|
||||
$data = [
|
||||
'name' => $user->name,
|
||||
'lastname' => $user->lastname,
|
||||
'eventName' => $event->name,
|
||||
];
|
||||
Mail::to($user->email)->send(new EventParticipationCancelledMail($data));
|
||||
|
||||
}
|
||||
|
||||
$event->delete();
|
||||
|
||||
Reference in New Issue
Block a user