Validate recipients and improve SMS notification handling
Add recipient validation to the SMS gateway API to ensure no empty recipient arrays are processed. Enhance department SMS notification logic by dynamically retrieving phone numbers and logging failures for improved error tracking. Simplify SMS delivery flag logic for better readability.
This commit is contained in:
@@ -331,4 +331,15 @@ class departments_o extends db
|
||||
self::requireSelected();
|
||||
return (new branding_o())->select($this->branding->value());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the phone numbers for the SMS notification
|
||||
* @note This is a link to the department_notification_sms_o::getDepartmentActivePhoneNumbers method
|
||||
* @throws Exception If the department is not selected
|
||||
*/
|
||||
public function notificationSmsPhoneNumbers(): array
|
||||
{
|
||||
self::requireSelected();
|
||||
return (new department_notification_sms_o())->getDepartmentActivePhoneNumbers($this->id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user