create a mail when a user is unassigned to a task by an administrator

This commit is contained in:
2026-03-18 16:14:35 +01:00
parent 2921cbdcbd
commit 92de307017
3 changed files with 103 additions and 0 deletions
+10
View File
@@ -6,6 +6,7 @@ use App\Events\TaskParticipationCancelled;
use App\Events\VolunteerAssignedToTask;
use App\Events\VolunteerUnassignedFromTask;
use App\Mail\VolunteerAssignToTaskMail;
use App\Mail\VolunteerUnassignToTaskMail;
use App\Models\Events;
use App\Models\Task;
use App\Models\User;
@@ -244,6 +245,15 @@ class TasksController extends Controller
$task,
$event
));
$data = [
'name' => $user->name,
'lastname' => $user->lastname,
'taskName' => $task->name,
'start' => $task->start,
'end' => $task->end,
];
Mail::to($user->email)->send(new VolunteerUnassignToTaskMail($data));
}
return response()->json(['message' => "User unassigned successfully"], 200);