Alert Notification Email template: Format the timestamps/timeranges in Email

1. Describe your incident:
Hi there,
I have configured an Email notification and it works fine.

Here’s how it looks:

<table width="100%" border="0" cellpadding="10" cellspacing="0" style="background-color:#f9f9f9;border:none;line-height:1.2"><tbody>
<tr><th colspan="2" style="background-color: #fd1c1c;line-height:1.5">Some Text</th></tr>
<tr><td>Message</td><td>${event.message}</td></tr>
<tr><td>First error</td><td>${event.timerange_start}</td></tr>
<tr>Timerange:</tr>
<tr><td>From</td><td>${event.timerange_start}</td></tr>
<tr><td>Til</td><td>${event.timerange_end}</td></tr>
</tbody></table>
${if backlog}
<br /><table width="100%" border="0" cellpadding="10" cellspacing="0" style="background-color:#f9f9f9;border:none;line-height:1.2"><tbody>
<tr><th style="background-color:#e6e6e6;line-height:1.5">All other messages</th></tr>
${foreach backlog message}
<tr><td>${message.timestamp} | ${message.message}</td></tr>
${end}
</tbody></table>
${end}

Now I’d like to format the timestamps/timeranges (event.timerange_start, event.timerange_end and message.timestamp) to make it more readable/user-friendly.
For now it is displayed as “2024-08-08T10:08:43.064Z”.
What I’d like it to be: “2024-08-08 10:08:43”

So the question is, if there’s a way to alter the format of the timestamps/timeranges? I’ve read through the docs, existing metadata and forum, but couldn’t find any hints to that issue.

Bonus question, which is kinda metadata related: We have the event_definition_description metadata field. Is there an equivalent notification_definition_description field I can use?

2. Describe your environment:

Version 5.2.7+5e29a2c on 3cd583c1a084 (Eclipse Adoptium 17.0.11 on Linux 5.10.0-28-amd64)

3. What steps have you already taken to try and solve the problem?
I’ve read through the docs, existing metadata and forum, googled too, but couldn’t find any hints to that issue.

4. How can the community help?
Any tips?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.