Pārlūkot izejas kodu

remove bounced_email param from send_email_with_rate_control

Son NK 5 gadi atpakaļ
vecāks
revīzija
0c4e48c906
2 mainītis faili ar 0 papildinājumiem un 7 dzēšanām
  1. 0 1
      app/email_utils.py
  2. 0 6
      email_handler.py

+ 0 - 1
app/email_utils.py

@@ -228,7 +228,6 @@ def send_email_with_rate_control(
     subject,
     subject,
     plaintext,
     plaintext,
     html=None,
     html=None,
-    bounced_email: Optional[Message] = None,
     max_alert_24h=MAX_ALERT_24H,
     max_alert_24h=MAX_ALERT_24H,
 ) -> bool:
 ) -> bool:
     """Same as send_email with rate control over alert_type.
     """Same as send_email with rate control over alert_type.

+ 0 - 6
email_handler.py

@@ -836,7 +836,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User):
         send_email_with_rate_control(
         send_email_with_rate_control(
             user,
             user,
             ALERT_BOUNCE_EMAIL,
             ALERT_BOUNCE_EMAIL,
-            # use user mail here as only user is authenticated to see the refused email
             user.email,
             user.email,
             f"Email from {contact.website_email} to {address} cannot be delivered to your inbox",
             f"Email from {contact.website_email} to {address} cannot be delivered to your inbox",
             render(
             render(
@@ -857,8 +856,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User):
                 refused_email_url=refused_email_url,
                 refused_email_url=refused_email_url,
                 mailbox_email=mailbox.email,
                 mailbox_email=mailbox.email,
             ),
             ),
-            # cannot include bounce email as it can contain spammy text
-            # bounced_email=msg,
         )
         )
     # disable the alias the second time email is bounced
     # disable the alias the second time email is bounced
     elif nb_bounced >= 2:
     elif nb_bounced >= 2:
@@ -876,7 +873,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User):
         send_email_with_rate_control(
         send_email_with_rate_control(
             user,
             user,
             ALERT_BOUNCE_EMAIL,
             ALERT_BOUNCE_EMAIL,
-            # use user mail here as only user is authenticated to see the refused email
             user.email,
             user.email,
             f"Alias {address} has been disabled due to second undelivered email from {contact.website_email}",
             f"Alias {address} has been disabled due to second undelivered email from {contact.website_email}",
             render(
             render(
@@ -895,8 +891,6 @@ def handle_bounce(contact: Contact, alias: Alias, msg: Message, user: User):
                 refused_email_url=refused_email_url,
                 refused_email_url=refused_email_url,
                 mailbox_email=mailbox.email,
                 mailbox_email=mailbox.email,
             ),
             ),
-            # cannot include bounce email as it can contain spammy text
-            # bounced_email=msg,
         )
         )