create a notification when an alias is disabled
This commit is contained in:
parent
0e3a5c3d3c
commit
fb00c18d5a
|
@ -1403,6 +1403,15 @@ def handle_bounce_forward_phase(msg: Message, email_log: EmailLog):
|
||||||
alias.enabled = False
|
alias.enabled = False
|
||||||
Session.commit()
|
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(
|
send_email_with_rate_control(
|
||||||
user,
|
user,
|
||||||
ALERT_BOUNCE_EMAIL,
|
ALERT_BOUNCE_EMAIL,
|
||||||
|
|
10
templates/notification/alias-disable.html
Normal file
10
templates/notification/alias-disable.html
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<div>
|
||||||
|
There are several emails sent to your alias <b>{{ alias.email }}</b> that have been bounced by your
|
||||||
|
mailbox <b>{{ mailbox.email }}</b>.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
As security measure, we have disabled the alias <b>{{ alias.email }}</b>.
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue