Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Add triggerDate support to email notification channel#1746

Merged
DavidWiseman merged 6 commits intotrimble-oss:mainfrom
BenjaBelnap:trigger-date-alert-email-channel
Feb 11, 2026
Merged

Add triggerDate support to email notification channel#1746
DavidWiseman merged 6 commits intotrimble-oss:mainfrom
BenjaBelnap:trigger-date-alert-email-channel

Conversation

@BenjaBelnap
Copy link
Copy Markdown
Contributor

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.

image

Copilot AI review requested due to automatic review settings February 9, 2026 22:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 base Placeholders list and implemented replacement logic in NotificationChannelBase.ReplacePlaceholders.
  • Updated EmailNotificationChannel template 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.

Comment thread DBADash/Alert/NotificationChannelBase.cs Outdated
Comment thread DBADash/Alert/NotificationChannelBase.cs Outdated
Comment thread DBADash.Test/NotificationChannelTest.cs Outdated
BenjaBelnap and others added 3 commits February 9, 2026 15:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@BenjaBelnap
Copy link
Copy Markdown
Contributor Author

This is now ready for review

@DavidWiseman
Copy link
Copy Markdown
Collaborator

Thank you for the pull request! 🙏 I'll review it soon.

Ben Belnap and others added 2 commits February 10, 2026 09:50
Add support for converting to other time zones. e.g. {TriggerDate:America/New_York}.  Update date format to add utc offset.  Update tests
@DavidWiseman DavidWiseman merged commit 1680756 into trimble-oss:main Feb 11, 2026
@DavidWiseman
Copy link
Copy Markdown
Collaborator

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. {TriggerDate:America/New_York}

Converted and formatted with the offset included for clarity:
image

Of if you use {TriggerDate} it will format the same way as before with Z as the UTC indicator.

image

A formatting mistake I made is corrected by #1749

Thanks again,

David

@BenjaBelnap
Copy link
Copy Markdown
Contributor Author

Awesome! That time zone conversion is a feature we'll use. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Trigger Date to email notification

3 participants