From 6c3a668400557719aa939640899de84d6b5fb192 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 5 Mar 2024 10:30:24 -0800 Subject: [PATCH] checks to see if a user has an email before sending them a reminder email. --- app/Http/Controllers/ReportsController.php | 4 ++++ resources/lang/en-US/general.php | 1 + 2 files changed, 5 insertions(+) diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 33c1f0a938..31cefa4436 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -1178,6 +1178,10 @@ class ReportsController extends Controller } } + if ($assetItem->assignedTo->email == ''){ + return redirect()->route('reports/unaccepted_assets')->with('error', trans('general.no_email')); + } + return redirect()->route('reports/unaccepted_assets')->with('success', trans('admin/reports/general.reminder_sent')); } diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php index f7fb41743e..d879ef7db3 100644 --- a/resources/lang/en-US/general.php +++ b/resources/lang/en-US/general.php @@ -201,6 +201,7 @@ return [ 'new_password' => 'New Password', 'next' => 'Next', 'next_audit_date' => 'Next Audit Date', + 'no_email' => 'No email address associated with this user', 'last_audit' => 'Last Audit', 'new' => 'new!', 'no_depreciation' => 'No Depreciation',