Add support for notification dry run feature

- Introduced NOTIFICATION_DRY_RUN configuration option in .env.example and k8s/secret.example.yaml.
- Updated README.md to include usage instructions for the new dry run feature.
- Implemented logic in app.go to preview notifications without sending them when the dry run option is enabled.
- Enhanced config.go to load the new configuration option and validate notification types accordingly.
- Added a new function in notify.go to generate manual-needed notification messages for preview.
This commit is contained in:
Zsolt Alföldi
2026-05-07 00:35:05 +02:00
parent 469e5b0678
commit ecea084003
8 changed files with 92 additions and 2 deletions

View File

@@ -104,6 +104,11 @@ func (s NotificationSMTP) SendManualNeeded(results []model.ActionResult) error {
return nil
}
func ManualNeededMessage(results []model.ActionResult) (string, string, bool) {
body, ok := manualNeededText(results)
return manualNeededSubject, body, ok
}
func manualNeededText(results []model.ActionResult) (string, bool) {
var body strings.Builder
manualCount := 0