File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Entrypoints/Activity Triggers/Standards Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -36,15 +36,19 @@ function Push-CippDriftManagement {
3636
3737 $GenerateEmail = New-CIPPAlertTemplate - format ' html' - data $Data - CIPPURL $CIPPURL - Tenant $Item.Tenant - InputObject ' driftStandard' - AuditLogLink $drift.standardId
3838
39- # Send email alert if configured
40- $CIPPAlert = @ {
41- Type = ' email'
42- Title = $GenerateEmail.title
43- HTMLContent = $GenerateEmail.htmlcontent
44- TenantFilter = $Item.Tenant
39+ # Send email alert if configured and not disabled
40+ if (-not $Settings.driftAlertDisableEmail ) {
41+ $CIPPAlert = @ {
42+ Type = ' email'
43+ Title = $GenerateEmail.title
44+ HTMLContent = $GenerateEmail.htmlcontent
45+ TenantFilter = $Item.Tenant
46+ }
47+ Write-Information " Sending email alert for tenant $ ( $Item.Tenant ) "
48+ Send-CIPPAlert @CIPPAlert - altEmail $email
49+ } else {
50+ Write-Information " Email alert disabled for tenant $ ( $Item.Tenant ) "
4551 }
46- Write-Information " Sending email alert for tenant $ ( $Item.Tenant ) "
47- Send-CIPPAlert @CIPPAlert - altEmail $email
4852 # Send webhook alert if configured
4953 $WebhookData = @ {
5054 Title = $GenerateEmail.title
Original file line number Diff line number Diff line change @@ -317,6 +317,7 @@ function Get-CIPPTenantAlignment {
317317 standardSettings = $Template.Standards
318318 driftAlertEmail = $Template.driftAlertEmail
319319 driftAlertWebhook = $Template.driftAlertWebhook
320+ driftAlertDisableEmail = $Template.driftAlertDisableEmail
320321 AlignmentScore = $AlignmentPercentage
321322 LicenseMissingPercentage = $LicenseMissingPercentage
322323 CombinedScore = $AlignmentPercentage + $LicenseMissingPercentage
You can’t perform that action at this time.
0 commit comments