Skip to content

Commit 0329521

Browse files
committed
Merge branch 'dev' of https://github.com/KelvinTegelaar/CIPP-API into dev
2 parents 4707a6a + 943cbcd commit 0329521

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Push-SchedulerCIPPNotifications.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function Push-SchedulerCIPPNotifications {
5353
}
5454
}
5555
if ($CurrentStandardsLogs) {
56-
foreach ($tenant in ($CurrentLog.Tenant | Sort-Object -Unique)) {
56+
foreach ($tenant in ($CurrentStandardsLogs.Tenant | Sort-Object -Unique)) {
5757
$Data = ($CurrentStandardsLogs | Where-Object -Property tenant -EQ $tenant)
5858
$Subject = "$($Tenant): Standards are out of sync for $tenant"
5959
$HTMLContent = New-CIPPAlertTemplate -Data $Data -Format 'html' -InputObject 'standards'

Modules/CIPPCore/Public/New-CIPPAlertTemplate.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,21 @@ function New-CIPPAlertTemplate {
2525
$DataHTML = ($Data | Select-Object * -ExcludeProperty Etag, PartitionKey, TimeStamp | ConvertTo-Html | Out-String).Replace('<table>', ' <table class="table-modern">')
2626
$IntroText = "<p>You've configured CIPP to send you alerts based on the logbook. The following alerts match your configured rules</p>$dataHTML"
2727
$ButtonUrl = "$CIPPURL/cipp/logs"
28-
$ButtonText = 'C heck logbook information'
28+
$ButtonText = 'Check logbook information'
2929
}
3030
if ($InputObject -eq 'standards') {
3131
$DataHTML = foreach ($object in $data) {
32-
"<p>For the standard $($object.standardName) in template {{Template Name }} we've detected:</p> <li>$($object.message)</li>"
32+
"<p>For the standard $($object.standardName) in template {{Template Name }} we've detected the following:</p> <li>$($object.message)</li>"
3333
if ($object.object) {
3434
$object.object = $object.object | ConvertFrom-Json
3535
$object.object = $object.object | Select-Object * -ExcludeProperty Etag, PartitionKey, TimeStamp
36-
($object.object.compare | ConvertTo-Html -Fragment | Out-String).Replace('<table>', ' <table class="table-modern">')
36+
if ($object.object.compare) {
37+
'<p>The following differences have been detected:</p>'
38+
($object.object.compare | ConvertTo-Html -Fragment | Out-String).Replace('<table>', ' <table class="table-modern">')
39+
} else {
40+
'<p>This is a table representation of the current settings:</p>'
41+
($object.object | ConvertTo-Html -Fragment -As List | Out-String).Replace('<table>', ' <table class="table-modern">')
42+
}
3743
}
3844

3945
}

0 commit comments

Comments
 (0)