improve bounce email notification

This commit is contained in:
Son 2021-10-28 11:43:44 +02:00
parent a4dbbb6ac2
commit 5f6ad21e85
3 changed files with 18 additions and 17 deletions

View File

@ -1297,16 +1297,18 @@ def handle_bounce_forward_phase(msg: Message, email_log: EmailLog):
alias,
)
disable_alias_link = f"{URL}/dashboard/unsubscribe/{alias.id}"
block_sender_link = f"{URL}/dashboard/alias_contact_manager/{alias.id}?highlight_contact_id={contact.id}"
send_email_with_rate_control(
user,
ALERT_BOUNCE_EMAIL,
user.email,
f"Email from {contact.website_email} to {alias.email} cannot be delivered to your mailbox",
render(
"transactional/bounce/bounced-email.txt",
"transactional/bounce/bounced-email.txt.jinja2",
alias=alias,
website_email=contact.website_email,
disable_alias_link=disable_alias_link,
block_sender_link=block_sender_link,
refused_email_url=refused_email_url,
mailbox_email=mailbox.email,
),

View File

@ -9,7 +9,7 @@
{% endcall %}
{% call text() %}
This is usually because your mailbox service thinks the email is a <b>spam</b>.
This is usually because your mailbox service thinks the email is <b>spam</b>.
{% endcall %}
{{ render_button("View the bounced email", refused_email_url) }}
@ -20,21 +20,21 @@
Please consider the following options: <br>
<ol>
<li>If the email is not spam at all, you can create a <b>filter</b> to explicitly allow this email
or simply all emails from SimpleLogin. <br>
How to create the filter depends on your mailbox service.
<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 a spam, it means your alias {{alias.email}} is now in the hands of a spammer. <br>
You should <b>disable</b> the alias immediately. <br>
We'll <b>automatically</b> disable this alias when too many emails sent to it are bounced.
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>
<br>
Please note that the alias can be automatically disabled if too many emails sent to it are bounced.
{% endcall %}
{{ render_button("Disable alias", disable_alias_link) }}
{{ render_text('Thanks, <br />SimpleLogin Team.') }}
{{ raw_url(disable_alias_link) }}
{% endblock %}

View File

@ -7,15 +7,14 @@ The email is automatically deleted in 7 days.
Please consider the following options:
1. If the email is not spam at all, you can create a "filter" to explicitly allow this email
or simply all emails from SimpleLogin.
How to create the filter depends on your mailbox service.
1. If the email is not spam at all, you can create a "filter" to explicitly allow all emails from SimpleLogin.
We have a small gudie on https://simplelogin.io/docs/getting-started/troubleshooting/
2. If this email is spam, it means your alias {{alias}} is now in the hands of a spammer.
You should disable or delete the alias immediately.
We'll automatically disable this alias the second time the email is refused.
You can either disable the alias on {{disable_alias_link}}
or block the sender on {{ block_sender_link }} if they send too many spams.
{{disable_alias_link}}
Please note that the alias can be automatically disabled if too many emails sent to it are bounced.
Thanks,
SimpleLogin team.