feat: implement email notification for internship status updates and add missing student relationship

This commit is contained in:
2025-11-06 11:04:08 +01:00
parent 9a69cf0ab3
commit c030ac8971
5 changed files with 114 additions and 0 deletions

View File

@@ -2,10 +2,12 @@
namespace App\Http\Controllers;
use App\Mail\InternshipStatusUpdated;
use App\Models\Internship;
use App\Models\InternshipStatus;
use App\Models\User;
use Illuminate\Http\Request;
use Mail;
class InternshipStatusController extends Controller
{
@@ -127,6 +129,8 @@ class InternshipStatusController extends Controller
'modified_by' => $user->id
]);
Mail::to($internship->student)->sendNow(new InternshipStatusUpdated($internship, $user->name, $internship->student->name, $internship->company->name, $internshipStatus->status, $request->status, $request->note));
return response()->noContent();
}