From 032276b44d5b37be489980b51f9f9c4f615408ec Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Mon, 15 Sep 2025 11:04:37 +0200 Subject: [PATCH 1/2] mail notifications : set undefined PREVIOUS*HARDSTATE to UNKNOWN for state_mapping --- notifications/templates/mail/bulk.html | 2 +- notifications/templates/mail/summary.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/notifications/templates/mail/bulk.html b/notifications/templates/mail/bulk.html index c8515ed361a..6d9ba6fcf52 100644 --- a/notifications/templates/mail/bulk.html +++ b/notifications/templates/mail/bulk.html @@ -29,7 +29,7 @@
{% if service_notification %} diff --git a/notifications/templates/mail/summary.html b/notifications/templates/mail/summary.html index 9947774677f..95ac7c678c5 100644 --- a/notifications/templates/mail/summary.html +++ b/notifications/templates/mail/summary.html @@ -33,7 +33,7 @@
{% if service_notification %} From 543ac6788111c8c12d107cf17d17e18ca1752325 Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Mon, 15 Sep 2025 11:56:49 +0200 Subject: [PATCH 2/2] mail notifications : set undefined PREVIOUS*HARDSTATE to NULL for short name in order to reflect the undefined state --- notifications/templates/mail/bulk.html | 4 ++-- notifications/templates/mail/summary.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/notifications/templates/mail/bulk.html b/notifications/templates/mail/bulk.html index 6d9ba6fcf52..a5c99a1da45 100644 --- a/notifications/templates/mail/bulk.html +++ b/notifications/templates/mail/bulk.html @@ -33,9 +33,9 @@ display: inline-block; /* Inline block to respect width */"> {% if service_notification %} - {{ entry.PREVIOUSSERVICEHARDSTATE[:4] }} + {{ (entry.PREVIOUSSERVICEHARDSTATE|default("NULL"))[:4] }} {% else %} - {{ entry.PREVIOUSHOSTHARDSTATE[:4] }} + {{ (entry.PREVIOUSHOSTHARDSTATE|default("NULL"))[:4] }} {% endif %}
diff --git a/notifications/templates/mail/summary.html b/notifications/templates/mail/summary.html index 95ac7c678c5..49e23163192 100644 --- a/notifications/templates/mail/summary.html +++ b/notifications/templates/mail/summary.html @@ -37,9 +37,9 @@ display: inline-block; /* Inline block to respect width */"> {% if service_notification %} - {{ data.PREVIOUSSERVICEHARDSTATE[:4] }} + {{ (data.PREVIOUSSERVICEHARDSTATE|default("NULL"))[:4] }} {% else %} - {{ data.PREVIOUSHOSTHARDSHORTSTATE[:4] }} + {{ (data.PREVIOUSHOSTHARDSHORTSTATE|default("NULL"))[:4] }} {% endif %}