Add support for customer booking notifications and phone number updates

- Introduced phone number update functionality in `userSecurityRoute`.
- Enhanced `order_bookings_o` to send booking confirmations to customers via SMS and email.
- Added `sendOrderBookingConfirmationEmail` method in `email` for HTML-based email notifications.
- Updated `notifyNewBooking` to include customer confirmation logic with SMS and email.
- Adjusted `users_o` to make phone and email properties public and added `setPhoneNumber` method.
- Optimized notification logic in `order_bookings_o` with department and customer-specific notifications.
This commit is contained in:
Jeppe Bundgaard
2025-11-11 13:24:32 +01:00
parent 7f838c0961
commit ccb049519c
4 changed files with 175 additions and 36 deletions
+15 -3
View File
@@ -34,9 +34,9 @@ class users_o extends db
public language_pack_en_us $language_pack;
public object_property $xlvask_customer_id;
protected object_property $password;
protected object_property $phone_country_code;
protected object_property $phone;
protected object_property $email;
public object_property $phone_country_code;
public object_property $phone;
public object_property $email;
protected array $wash_subscription_transactions;
public function structure(): void
@@ -1333,4 +1333,16 @@ class users_o extends db
return $customer_numbers;
}
/**
* @throws Exception
*/
public function setPhoneNumber(int $phone_number, int $country_code = 45): void
{
self::requireSelected();
// Set the phone number
$this->phone->set((int)$phone_number);
$this->phone_country_code->set((int)$country_code);
$this->objectChanged();
}
}