Skip to content

Commit cdd9bbc

Browse files
drift email fix
1 parent eb5975e commit cdd9bbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Modules/CIPPCore/Public/Send-CIPPAlert.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ function Send-CIPPAlert {
2222
Write-Information 'Trying to send email'
2323
try {
2424
if ($Config.email -like '*@*' -or $altEmail -like '*@*') {
25-
$Recipients = if ($AltEmail) { $AltEmail }
26-
else {
25+
$Recipients = if ($AltEmail) {
26+
[pscustomobject]@{EmailAddress = @{Address = $AltEmail } }
27+
} else {
2728
$Config.email.split($(if ($Config.email -like '*,*') { ',' } else { ';' })).trim() | ForEach-Object { if ($_ -like '*@*') { [pscustomobject]@{EmailAddress = @{Address = $_ } } } }
2829
}
2930
$PowerShellBody = [PSCustomObject]@{

0 commit comments

Comments
 (0)