From fed52c5890ec26d3ae06c17fabe00f57a5bf5b55 Mon Sep 17 00:00:00 2001 From: tigattack <10629864+tigattack@users.noreply.github.com> Date: Mon, 19 May 2025 23:17:52 +0100 Subject: [PATCH 1/2] feat(conf): add mention.on_success to example & schema --- config/conf.example.json | 3 ++- config/schema.json | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/conf.example.json b/config/conf.example.json index b118639..f0f4612 100644 --- a/config/conf.example.json +++ b/config/conf.example.json @@ -30,7 +30,8 @@ }, "mentions": { "on_failure": false, - "on_warning": false + "on_warning": false, + "on_success": false }, "notifications": { "on_success": true, diff --git a/config/schema.json b/config/schema.json index 1f5cde2..5a87f76 100644 --- a/config/schema.json +++ b/config/schema.json @@ -131,6 +131,9 @@ }, "on_warning": { "type": "boolean" + }, + "on_success": { + "type": "boolean" } } }, From 2a6f434084e5bda8bef58ff6d1a9fa1c28351f6a Mon Sep 17 00:00:00 2001 From: tigattack <10629864+tigattack@users.noreply.github.com> Date: Mon, 19 May 2025 23:18:19 +0100 Subject: [PATCH 2/2] feat(alertsender): mention user on success if mention.on_success --- AlertSender.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AlertSender.ps1 b/AlertSender.ps1 index 580a19a..81a1d1e 100644 --- a/AlertSender.ps1 +++ b/AlertSender.ps1 @@ -272,6 +272,16 @@ try { Write-LogMessage -Tag 'WARN' -Message "Unable to determine 'mention on warning' configuration. User will not be mentioned." } + ## On success + try { + if ($Config.mentions.on_success -and $status -eq 'Success') { + $mention = $true + } + } + catch { + Write-LogMessage -Tag 'WARN' -Message "Unable to determine 'mention on success' configuration. User will not be mentioned." + } + # Define footer message. $footerMessage = "tigattack's VeeamNotify $($updateStatus.CurrentVersion)"