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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user