diff --git a/application/libraries/Notifications.php b/application/libraries/Notifications.php index 27fdd562..61354c60 100644 --- a/application/libraries/Notifications.php +++ b/application/libraries/Notifications.php @@ -85,10 +85,10 @@ class Notifications { $ics_stream = $this->CI->ics_file->get_stream($appointment, $service, $provider, $customer); // Notify customer. - $send_customer = filter_var( - setting('customer_notifications'), - FILTER_VALIDATE_BOOLEAN - ); + $send_customer = ! empty($customer['email']) && filter_var( + setting('customer_notifications'), + FILTER_VALIDATE_BOOLEAN + ); if ($send_customer === TRUE) { @@ -232,10 +232,10 @@ class Notifications { } // Notify customer. - $send_customer = filter_var( - setting('customer_notifications'), - FILTER_VALIDATE_BOOLEAN - ); + $send_customer = ! empty($customer['email']) && filter_var( + setting('customer_notifications'), + FILTER_VALIDATE_BOOLEAN + ); if ($send_customer === TRUE) {