feat: notify company of internship status updates

This commit is contained in:
Veronika Fehérvíziová
2025-12-02 22:52:22 +01:00
parent a9ac8a2735
commit 06e6e59a18

View File

@@ -123,17 +123,30 @@ class InternshipStatusDataController extends Controller
'modified_by' => $user->id
]);
// mail študentovi
Mail::to($internship->student)
->sendNow(new InternshipStatusUpdated(
$internship,
$user->name,
$internship->student->name,
$internship->company->name,
$internshipStatus->status,
$request->enum('status', InternshipStatus::class),
$request->note
$newStatus->status,
$request->note,
$user,
recipiantIsStudent: true,
));
// ak zmenu nevykonala firma, posleme mail aj firme
if ($user->id !== $internship->company->contactPerson->id) {
Mail::to($internship->company->contactPerson->email)
->sendNow(new InternshipStatusUpdated(
$internship,
$internshipStatus->status,
$newStatus->status,
$request->note,
$user,
recipiantIsStudent: false,
));
}
$newStatus->save();
return response()->noContent();
}