Add company colors to notifications

This commit is contained in:
Marcel Link 2024-07-23 14:46:08 +02:00
parent 37374a254f
commit 493fff1f92
No known key found for this signature in database
9 changed files with 27 additions and 3 deletions

View File

@ -447,10 +447,13 @@ class Booking extends EA_Controller
$appointment_id = $this->appointments_model->save($appointment);
$appointment = $this->appointments_model->find($appointment_id);
$company_color = setting('company_color');
$settings = [
'company_name' => setting('company_name'),
'company_link' => setting('company_link'),
'company_email' => setting('company_email'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
'date_format' => setting('date_format'),
'time_format' => setting('time_format'),
];

View File

@ -88,10 +88,13 @@ class Booking_cancellation extends EA_Controller
$service = $this->services_model->find($appointment['id_services']);
$company_color = setting('company_color');
$settings = [
'company_name' => setting('company_name'),
'company_email' => setting('company_email'),
'company_link' => setting('company_link'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
'date_format' => setting('date_format'),
'time_format' => setting('time_format'),
];

View File

@ -278,10 +278,13 @@ class Calendar extends EA_Controller
$customer = $this->customers_model->find($appointment['id_users_customer']);
$service = $this->services_model->find($appointment['id_services']);
$company_color = setting('company_color');
$settings = [
'company_name' => setting('company_name'),
'company_link' => setting('company_link'),
'company_email' => setting('company_email'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
'date_format' => setting('date_format'),
'time_format' => setting('time_format'),
];
@ -354,10 +357,13 @@ class Calendar extends EA_Controller
$customer = $this->customers_model->find($appointment['id_users_customer']);
$service = $this->services_model->find($appointment['id_services']);
$company_color = setting('company_color');
$settings = [
'company_name' => setting('company_name'),
'company_email' => setting('company_email'),
'company_link' => setting('company_link'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
'date_format' => setting('date_format'),
'time_format' => setting('time_format'),
];

View File

@ -102,10 +102,13 @@ class Google extends EA_Controller
$local_events = [...$appointments, ...$unavailabilities];
$company_color = setting('company_color');
$settings = [
'company_name' => setting('company_name'),
'company_link' => setting('company_link'),
'company_email' => setting('company_email'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
];
$provider_timezone = new DateTimeZone($provider['timezone']);

View File

@ -67,11 +67,14 @@ class Recovery extends EA_Controller
$new_password = $this->accounts->regenerate_password($username, $email);
$company_color = setting('company_color');
if ($new_password) {
$settings = [
'company_name' => setting('company_name'),
'company_link' => setting('company_link'),
'company_email' => setting('company_email'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
];
$this->email_messages->send_password($new_password, $email, $settings);

View File

@ -272,10 +272,13 @@ class Appointments_api_v1 extends EA_Controller
$customer = $this->customers_model->find($appointment['id_users_customer'], true);
$company_color = setting('company_color');
$settings = [
'company_name' => setting('company_name'),
'company_email' => setting('company_email'),
'company_link' => setting('company_link'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
'date_format' => setting('date_format'),
'time_format' => setting('time_format'),
];
@ -352,10 +355,13 @@ class Appointments_api_v1 extends EA_Controller
$customer = $this->customers_model->find($deleted_appointment['id_users_customer'], true);
$company_color = setting('company_color');
$settings = [
'company_name' => setting('company_name'),
'company_email' => setting('company_email'),
'company_link' => setting('company_link'),
'company_color' => !empty($company_color) && $company_color != DEFAULT_COMPANY_COLOR ? $company_color : null,
'date_format' => setting('date_format'),
'time_format' => setting('time_format'),
];

View File

@ -14,7 +14,7 @@
<body style="font: 13px arial, helvetica, tahoma;">
<div class="email-container" style="width: 650px; border: 1px solid #eee; margin: 30px auto;">
<div id="header" style="background-color: #429a82; height: 45px; padding: 10px 15px;">
<div id="header" style="background-color: <?= $settings['company_color'] ?? '#429a82' ?>; height: 45px; padding: 10px 15px;">
<strong id="logo" style="color: white; font-size: 20px; margin-top: 10px; display: inline-block">
<?= e($settings['company_name']) ?>
</strong>

View File

@ -19,7 +19,7 @@
<body style="font: 13px arial, helvetica, tahoma;">
<div class="email-container" style="width: 650px; border: 1px solid #eee; margin: 30px auto;">
<div id="header" style="background-color: #429a82; height: 45px; padding: 10px 15px;">
<div id="header" style="background-color: <?= $settings['company_color'] ?? '#429a82' ?>; height: 45px; padding: 10px 15px;">
<strong id="logo" style="color: white; font-size: 20px; margin-top: 10px; display: inline-block">
<?= e($settings['company_name']) ?>
</strong>

View File

@ -23,7 +23,7 @@
<body style="font: 13px arial, helvetica, tahoma;">
<div class="email-container" style="width: 650px; border: 1px solid #eee; margin: 30px auto;">
<div id="header" style="background-color: #429a82; height: 45px; padding: 10px 15px;">
<div id="header" style="background-color: <?= $settings['company_color'] ?? '#429a82' ?>; height: 45px; padding: 10px 15px;">
<strong id="logo" style="color: white; font-size: 20px; margin-top: 10px; display: inline-block">
<?= e($settings['company_name']) ?>
</strong>