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)" 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" } } },