Skip to content

Commit 9909ca8

Browse files
committed
Update file: Mail notification password expiry.ps1
1 parent 18525f4 commit 9909ca8

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

scripts_staging/Backend/Mail notification password expiry.ps1

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ $FromEmail = $env:FROM_EMAIL
4444
$signmail = $env:SIGNMAIL
4545
$WarningThreshold = [int]$env:WARNING_THRESHOLD
4646
$CriticalThreshold = [int]$env:CRITICAL_THRESHOLD
47+
$EmailSignature = $env:EMAIL_SIGNATURE
4748

4849
function Convert-ToBoolean($value) {
4950
return $value -match '^(1|true|yes)$'
@@ -257,6 +258,22 @@ function ConvertTo-HtmlReport {
257258

258259
return $html
259260
}
261+
function Get-EmailSignature {
262+
if ($EmailSignature) {
263+
return $EmailSignature
264+
}
265+
266+
return @"
267+
<div style="margin-top: 20px; border-top: 1px solid #ccc; padding-top: 10px;">
268+
<p style="color: #666; font-size: 12px;">
269+
<strong>Service Informatique</strong><br>
270+
Téléphone : +33 (0)1 XX XX XX XX<br>
271+
Email : [email protected]<br>
272+
<em>Ce message est généré automatiquement, merci de ne pas y répondre directement.</em>
273+
</p>
274+
</div>
275+
"@
276+
}
260277

261278
function Send-EmailReport {
262279
param(
@@ -299,7 +316,6 @@ function Send-UserNotification {
299316
[string]$Recipient,
300317
[string]$Subject,
301318
[string]$Body,
302-
[string]$signmail,
303319
[string]$SmtpServer,
304320
[int]$Port = 25,
305321
[string]$FromAddress
@@ -437,7 +453,7 @@ foreach ($user in $reportData | Where-Object { $_.Status -in @("Warning", "Criti
437453
<p>Votre mot de passe est dans un état <strong class='$($user.Status.ToLower())'>$($user.Status)</strong>.</p>
438454
<p><strong>Date d'expiration:</strong> $expirationDate</p>
439455
<p>Veuillez mettre à jour votre mot de passe dès que possible pour éviter tout problème d'accès.</p>
440-
<p>$signmail</p>
456+
441457
</body>
442458
</html>
443459
"@

0 commit comments

Comments
 (0)