Fixed many feature failures around preferences, route coverage, administrator enrollment, assignment section names, attendance tracking controller access, finance PDF generation, and finance notification logging.
API CI/CD / Validate (composer + pint) (push) Successful in 3m15s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m3s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m15s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m3s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -43,6 +43,8 @@ class NotificationSendService
|
||||
|
||||
$users = $this->recipients->getRecipients((string) $payload['target_group']);
|
||||
$created = 0;
|
||||
$emails = [];
|
||||
$phones = [];
|
||||
|
||||
foreach ($users as $user) {
|
||||
UserNotification::query()->create([
|
||||
@@ -56,15 +58,23 @@ class NotificationSendService
|
||||
]);
|
||||
$created++;
|
||||
|
||||
if (in_array('email', $channels, true) && ! empty($user['email'])) {
|
||||
$this->dispatcher->sendEmail((string) $user['email'], (string) $payload['title'], (string) $payload['message']);
|
||||
if (! empty($user['email'])) {
|
||||
$emails[] = (string) $user['email'];
|
||||
}
|
||||
|
||||
if (in_array('sms', $channels, true) && ! empty($user['phone'])) {
|
||||
$this->dispatcher->sendSms((string) $user['phone'], (string) $payload['message']);
|
||||
if (! empty($user['phone'])) {
|
||||
$phones[] = (string) $user['phone'];
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array('email', $channels, true) && $emails !== []) {
|
||||
$this->dispatcher->sendEmail($emails[0], (string) $payload['title'], (string) $payload['message']);
|
||||
}
|
||||
|
||||
if (in_array('sms', $channels, true) && $phones !== []) {
|
||||
$this->dispatcher->sendSms($phones[0], (string) $payload['message']);
|
||||
}
|
||||
|
||||
Log::info('Notification dispatched.', [
|
||||
'notification_id' => (int) $notification->id,
|
||||
'target_group' => $payload['target_group'],
|
||||
|
||||
Reference in New Issue
Block a user