From 7f045ba535835779bf6cdf95338c1125f7592aa5 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 3 Jun 2024 09:25:21 -0400 Subject: [PATCH] Thresholding bounced newsletters email. --- utils/monitor_newsletter_delivery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/monitor_newsletter_delivery.py b/utils/monitor_newsletter_delivery.py index 253c4270f..7d6e036c5 100755 --- a/utils/monitor_newsletter_delivery.py +++ b/utils/monitor_newsletter_delivery.py @@ -24,7 +24,7 @@ def main(): delivered = stats["delivered"]["total"] accepted = stats["delivered"]["total"] bounced = stats["failed"]["permanent"]["total"] + stats["failed"]["temporary"]["total"] - if bounced / float(delivered) > 0.5: + if bounced / float(delivered) > 0.5 and bounced > 100: requests.post( "https://api.mailgun.net/v2/%s/messages" % settings.MAILGUN_SERVER_NAME, auth=("api", settings.MAILGUN_ACCESS_KEY),