to prevent duplicate emails, we might better remove owner and security email address from the notification recipient
This commit is contained in:
parent
7eb9c80fb2
commit
28e26a1baf
|
@ -140,12 +140,6 @@ def send_expiration_notifications(exclude):
|
||||||
notification_data.append(cert_data)
|
notification_data.append(cert_data)
|
||||||
security_data.append(cert_data)
|
security_data.append(cert_data)
|
||||||
|
|
||||||
notification_recipient = get_plugin_option(
|
|
||||||
"recipients", notification.options
|
|
||||||
)
|
|
||||||
if notification_recipient:
|
|
||||||
notification_recipient = notification_recipient.split(",")
|
|
||||||
|
|
||||||
if send_notification(
|
if send_notification(
|
||||||
"expiration", notification_data, [owner], notification
|
"expiration", notification_data, [owner], notification
|
||||||
):
|
):
|
||||||
|
@ -153,10 +147,16 @@ def send_expiration_notifications(exclude):
|
||||||
else:
|
else:
|
||||||
failure += 1
|
failure += 1
|
||||||
|
|
||||||
|
notification_recipient = get_plugin_option(
|
||||||
|
"recipients", notification.options
|
||||||
|
)
|
||||||
|
if notification_recipient:
|
||||||
|
notification_recipient = notification_recipient.split(",")
|
||||||
|
# removing owner and security_email from notification_recipient
|
||||||
|
notification_recipient = [i for i in notification_recipient if i not in security_email and i != owner]
|
||||||
|
|
||||||
if (
|
if (
|
||||||
notification_recipient
|
notification_recipient
|
||||||
and owner != notification_recipient
|
|
||||||
and security_email != notification_recipient
|
|
||||||
):
|
):
|
||||||
if send_notification(
|
if send_notification(
|
||||||
"expiration",
|
"expiration",
|
||||||
|
|
Loading…
Reference in New Issue