Update Slack notification logic and refine COUNT_ONLY summary rendering

- Swap `send_message` with `send_webhook_message` to fix departmental Slack notification issues.
- Adjust `COUNT_ONLY` in `renderDanishPeriodSummary` to exclude targets for raw count-focused alerts.
This commit is contained in:
Jeppe Bundgaard
2026-01-29 20:31:05 +01:00
parent 4f9c91dceb
commit 17325f565e
2 changed files with 4 additions and 3 deletions
@@ -48,7 +48,8 @@ class goals_progress_alert_renderer
$body = match ($criteria->progress_alert_progress_type) {
// New DK multi-line formats for COUNT_ONLY and ALL
PType::COUNT_ONLY => self::renderDanishPeriodSummary($criteria, includeTargets: true,
// COUNT_ONLY should show raw counts only (no targets/percent)
PType::COUNT_ONLY => self::renderDanishPeriodSummary($criteria, includeTargets: false,
header: [
$deptNames !== '' ? "$deptLabel: $deptNames" : null,
$customerNames !== '' ? "$customerLabel: $customerNames" : null,
@@ -350,8 +350,8 @@ class departmentGoalsRoute
if (empty($slackWebhook)) {
continue;
}
(new Slack())->send_message((string)goals_progress_alert_renderer::render($criteria, $dept), (string)$dept->name->value());
//(new Slack())->send_webhook_message((string)$message, (string)$dept->slack_webhook->value()); TODO: remove the above ^
//(new Slack())->send_message((string)goals_progress_alert_renderer::render($criteria, $dept), (string)$dept->name->value());
(new Slack())->send_webhook_message((string)goals_progress_alert_renderer::render($criteria, $dept), (string)$dept->slack_webhook->value());
}
} else {
(new Slack())->send_message($message);