Do not send an email to customer if no email is provided.

This commit is contained in:
Alex Tselegidis 2021-12-20 09:39:01 +01:00
parent bd9b5f196a
commit e4774ee991

View file

@ -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)
{