create a mail when an event is deleted to the participants

This commit is contained in:
2026-03-18 10:06:12 +01:00
parent 2271304044
commit f3d6f6bd11
3 changed files with 102 additions and 0 deletions
+11
View File
@@ -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();