Add methods to handle user notification preferences and update booking notification logic
- Introduced `wantsSmsNotifications`, `wantsEmailNotifications`, and `getWashCertificateEmail` methods in `users_o`. - Updated `order_bookings_o` to incorporate user notification preferences for sending SMS and email confirmations.
This commit is contained in:
@@ -176,6 +176,34 @@ class users_o extends db
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function wantsSmsNotifications(): bool
|
||||
{
|
||||
self::requireSelected();
|
||||
return (bool)$this->sms_notifications_enabled->value();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function wantsEmailNotifications(): bool
|
||||
{
|
||||
self::requireSelected();
|
||||
return (bool)$this->email_notifications_enabled->value();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getWashCertificateEmail(): string|null
|
||||
{
|
||||
self::requireSelected();
|
||||
return $this->wash_certificate_email->value();
|
||||
}
|
||||
|
||||
|
||||
public function add(string $customer_number, mixed $password, int $role = 0): void
|
||||
{
|
||||
global $db;
|
||||
|
||||
Reference in New Issue
Block a user