diff --git a/email_handler.py b/email_handler.py index e76de0ec..53831062 100644 --- a/email_handler.py +++ b/email_handler.py @@ -1403,6 +1403,15 @@ def handle_bounce_forward_phase(msg: Message, email_log: EmailLog): alias.enabled = False Session.commit() + Notification.create( + user_id=user.id, + title=f"{alias.email} has been disabled due to multiple bounces", + message=Notification.render( + "notification/alias-disable.html", alias=alias, mailbox=mailbox + ), + commit=True, + ) + send_email_with_rate_control( user, ALERT_BOUNCE_EMAIL, diff --git a/templates/notification/alias-disable.html b/templates/notification/alias-disable.html new file mode 100644 index 00000000..9c2b6720 --- /dev/null +++ b/templates/notification/alias-disable.html @@ -0,0 +1,10 @@ +