Skip to content

Commit

Permalink
Modified sending emails to verify an email is set in the config first.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjantzen committed Mar 1, 2022
1 parent beffa3c commit 45ee018
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions User_Billing_Update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ if ($UserAudit) {
$ContactWarningsJson | Out-File -FilePath $auditFilesPath
Write-Host "Exported contact warnings to a json file."

if ($WarnContacts) {
if ($WarnContacts -and $EmailFrom.Email -and $EmailTo_Audit[0] -and $EmailTo_Audit[0].Email) {
# Create some html for an email based on the $WarnContacts
$DueDate = $(get-date).AddDays(5).ToString("dddd, MMMM d")
$HTMLBody = ""
Expand Down Expand Up @@ -1874,7 +1874,10 @@ if ($BillingUpdate) {

# If there were changes to the amount of billed users, send an email to account (or if no billing history and this is a new setup)
# Custom Code
if (!(Test-Path variable:HistoryContactList) -or ($CheckChanges -and $TotalChanges -and (($TotalChanges | Select-Object -Last 1)."Billed FT" -ne 0 -or ($TotalChanges | Select-Object -Last 1)."Billed PT" -ne 0))) {
if ($EmailFrom.Email -and $EmailTo_BillingUpdate[0] -and $EmailTo_BillingUpdate[0].Email -and
(!(Test-Path variable:HistoryContactList) -or
($CheckChanges -and $TotalChanges -and (($TotalChanges | Select-Object -Last 1)."Billed FT" -ne 0 -or ($TotalChanges | Select-Object -Last 1)."Billed PT" -ne 0))))
{

# No past billing history
if (!(Test-Path variable:HistoryContactList) -or !$CheckChanges) {
Expand Down
2 changes: 1 addition & 1 deletion currentversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.12.1
2.12.2

0 comments on commit 45ee018

Please sign in to comment.