You've already forked isop-mirror
feat: notify company of internship status updates
This commit is contained in:
@@ -123,17 +123,30 @@ class InternshipStatusDataController extends Controller
|
|||||||
'modified_by' => $user->id
|
'modified_by' => $user->id
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// mail študentovi
|
||||||
Mail::to($internship->student)
|
Mail::to($internship->student)
|
||||||
->sendNow(new InternshipStatusUpdated(
|
->sendNow(new InternshipStatusUpdated(
|
||||||
$internship,
|
$internship,
|
||||||
$user->name,
|
|
||||||
$internship->student->name,
|
|
||||||
$internship->company->name,
|
|
||||||
$internshipStatus->status,
|
$internshipStatus->status,
|
||||||
$request->enum('status', InternshipStatus::class),
|
$newStatus->status,
|
||||||
$request->note
|
$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();
|
$newStatus->save();
|
||||||
return response()->noContent();
|
return response()->noContent();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user