Skip to content

feat: add HTML email templates and stabilized recovery notifications#10

Merged
javaChip56 merged 15 commits intomasterfrom
enhancements
Mar 20, 2026
Merged

feat: add HTML email templates and stabilized recovery notifications#10
javaChip56 merged 15 commits intomasterfrom
enhancements

Conversation

@javaChip56
Copy link
Owner

Summary

This PR upgrades notification emails from hard-coded plain text to a file-based templating system with HTML support, and extends the notification flow to send a one-time Stabilized message when an endpoint settles after recovery.

What Changed

  • added file-based notification email templates under src/ApiHealthDashboard/Templates/Email
  • added notification.html for richer HTML email rendering
  • kept notification.txt as the plain-text fallback body
  • introduced NotificationEmailTemplateRenderer to render notification content from template files
  • added Email:Templates configuration in appsettings for template path and file names
  • updated SMTP sending to emit multipart email with HTML and plain-text alternatives
  • updated notification delivery to use the new template renderer instead of a hard-coded body builder
  • added a Stabilized notification event when an endpoint moves from a non-stable recovery trend into a Stable ... trend
  • copied email template files to build and publish output
  • documented the new email template behavior in the README

Testing

  • dotnet test ApiHealthDashboard.sln -c Release --no-restore

Result:

  • 95 tests passed

Notes

  • Email templates are now editable without changing notification code
  • If template files are missing or fail to render, the app falls back gracefully to built-in plain-text content
  • Restart the running Debug app to pick up updated template/config changes

gali and others added 15 commits March 18, 2026 22:51
- Introduced email notification settings in the Import page for notification emails and CC recipients.
- Enhanced the ImportModel to handle notification email inputs.
- Configured SMTP settings in the application to enable email sending.
- Implemented IEmailSender and SmtpEmailSender for sending emails via SMTP.
- Created EndpointEmailNotificationService to manage notification logic based on endpoint status changes.
- Updated PollingSchedulerService to trigger notifications on state changes.
- Added email validation for notification addresses.
- Updated dashboard configuration to include notification settings.
- Created tests for the new email notification service and its integration with endpoint state changes.
Copy link
Owner Author

@javaChip56 javaChip56 left a comment

Choose a reason for hiding this comment

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

Ok for merge.

@javaChip56 javaChip56 merged commit e2b6d6f into master Mar 20, 2026
5 checks passed
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.

1 participant