Add triggerDate support to email notification channel#1746
Add triggerDate support to email notification channel#1746DavidWiseman merged 6 commits intotrimble-oss:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new {TriggerDate} placeholder to notification templates so email (and other channels using ReplacePlaceholders) can include the alert’s trigger timestamp.
Changes:
- Added
{TriggerDate}to the basePlaceholderslist and implemented replacement logic inNotificationChannelBase.ReplacePlaceholders. - Updated
EmailNotificationChanneltemplate placeholder documentation to include{TriggerDate}. - Added MSTest unit coverage verifying formatting and case-insensitive matching for
{TriggerDate}.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| DBADash/Alert/NotificationChannelBase.cs | Introduces {TriggerDate} placeholder support via placeholder list + replacement formatting. |
| DBADash/Alert/EmailNotificationChannel.cs | Documents {TriggerDate} as an available placeholder in subject/body templates. |
| DBADash.Test/NotificationChannelTest.cs | Adds tests validating {TriggerDate} substitution and case-insensitivity. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
This is now ready for review |
|
Thank you for the pull request! 🙏 I'll review it soon. |
Add support for converting to other time zones. e.g. {TriggerDate:America/New_York}. Update date format to add utc offset. Update tests
|
Hi, your PR is completed and it will be included in the next release. Everything was working great, but I've made some changes to support time zone conversion so the date can be displayed in a timezone of your choice. e.g. Converted and formatted with the offset included for clarity: Of if you use {TriggerDate} it will format the same way as before with Z as the UTC indicator.
A formatting mistake I made is corrected by #1749 Thanks again, David |
|
Awesome! That time zone conversion is a feature we'll use. Thanks! |


Resolves #1745
Problem: Email notifications lacked a way to display when an alert was first triggered.
Solution: Added {TriggerDate} placeholder to notification templates that displays the alert trigger date formatted as yyyy-MM-dd HH:mm:ss. Updated the ReplacePlaceholders method in NotificationChannelBase.cs, added it to the placeholders list, updated email template documentation in EmailNotificationChannel.cs, and created unit tests in NotificationChannelTest.cs to verify the functionality works correctly with case-insensitive matching.