mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 15:05:59 +08:00
create notification for bounce email during reply phase
This commit is contained in:
parent
90fa4abf69
commit
78c14fa67e
|
@ -1710,6 +1710,17 @@ def handle_bounce_reply_phase(envelope, msg: Message, email_log: EmailLog):
|
|||
alias,
|
||||
contact,
|
||||
)
|
||||
Notification.create(
|
||||
user_id=user.id,
|
||||
title=f"Email cannot be sent to { contact.email } from your alias { alias.email }",
|
||||
message=Notification.render(
|
||||
"notification/bounce-reply-phase.html",
|
||||
alias=alias,
|
||||
contact=contact,
|
||||
refused_email_url=refused_email.get_url(),
|
||||
),
|
||||
commit=True,
|
||||
)
|
||||
send_email_with_rate_control(
|
||||
user,
|
||||
ALERT_BOUNCE_EMAIL_REPLY_PHASE,
|
||||
|
|
39
templates/notification/bounce-reply-phase.html
Normal file
39
templates/notification/bounce-reply-phase.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
<div>
|
||||
This might mean {{ contact.email }}
|
||||
<ul>
|
||||
<li>is not a valid email address, or</li>
|
||||
<li>doesn't exist, or</li>
|
||||
<li>its mail server refuses your email</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<a href="{{ refused_email_url }}" class="btn btn-primary">
|
||||
View the bounced email
|
||||
</a>
|
||||
|
||||
<div>
|
||||
The email is automatically deleted in 7 days.
|
||||
</div>
|
||||
|
||||
<div>
|
||||
Please consider the following options: <br>
|
||||
|
||||
<ol>
|
||||
<li>If the email is not spam, you can create a
|
||||
<a href="https://simplelogin.io/docs/getting-started/troubleshooting/">filter</a>
|
||||
to explicitly allow all emails from SimpleLogin. <br>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
If this email is indeed spam, it means your alias {{ alias.email }} is now in the hands of a spammer.
|
||||
You can either <a href="{{ disable_alias_link }}">disable the alias</a>
|
||||
or <a href="{{ block_sender_link }}">block the sender</a> if they send too many spams.
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue