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:
Jepp9350
2025-04-22 15:24:04 +02:00
parent 0511e6e31e
commit 7a48710fb1
4 changed files with 52 additions and 12 deletions
@@ -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);
}
}