From 0e29744ec2c8a81eb199a6be1c550f624781f727 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 28 Sep 2017 20:57:33 -0700 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20try=20to=20send=20an=20email=20?= =?UTF-8?q?if=20the=20user=20doesn=E2=80=99t=20have=20an=20email=20address?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/AccessoriesController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/AccessoriesController.php b/app/Http/Controllers/AccessoriesController.php index 6658997cf7..b1c00d80f2 100755 --- a/app/Http/Controllers/AccessoriesController.php +++ b/app/Http/Controllers/AccessoriesController.php @@ -274,7 +274,7 @@ class AccessoriesController extends Controller $data['note'] = $logaction->note; $data['require_acceptance'] = $accessory->requireAcceptance(); // TODO: Port this to new mail notifications - if (($accessory->requireAcceptance()=='1') || ($accessory->getEula())) { + if ((($accessory->requireAcceptance()=='1') || ($accessory->getEula())) && ($user->email!='')) { Mail::send('emails.accept-accessory', $data, function ($m) use ($user) { $m->to($user->email, $user->first_name . ' ' . $user->last_name); @@ -351,7 +351,7 @@ class AccessoriesController extends Controller $data['item_tag'] = ''; $data['note'] = e($logaction->note); - if (($accessory->checkin_email()=='1')) { + if ((($accessory->checkin_email()=='1')) && ($user->email!='')) { Mail::send('emails.checkin-asset', $data, function ($m) use ($user) { $m->to($user->email, $user->first_name . ' ' . $user->last_name);