disable bounced email in alias log

This commit is contained in:
Son NK 2020-02-22 13:27:22 +07:00
parent 0e7a77130c
commit 74d1f87db0
3 changed files with 7 additions and 1 deletions

View File

@ -146,7 +146,9 @@ def get_alias_activities(alias_id):
activity["to"] = alias_log.alias
activity["from"] = alias_log.website_from or alias_log.website_email
if alias_log.blocked:
if alias_log.bounced:
activity["action"] = "bounced"
elif alias_log.blocked:
activity["action"] = "block"
else:
activity["action"] = "forward"

View File

@ -117,6 +117,8 @@
<img src="{{ url_for('static', filename='arrows/reply-arrow.svg') }}" class="arrow">
{% elif log.blocked %}
<img src="{{ url_for('static', filename='arrows/blocked-arrow.svg') }}" class="arrow">
{% elif log.bounced %}
<span class="text-danger"> --- Refused (or bounced) ---> </span>
{% else %}
<img src="{{ url_for('static', filename='arrows/forward-arrow.svg') }}" class="arrow">
{% endif %}

View File

@ -15,6 +15,7 @@ class AliasLog:
when: arrow.Arrow
is_reply: bool
blocked: bool
bounced: bool
def __init__(self, **kwargs):
for k, v in kwargs.items():
@ -79,6 +80,7 @@ def get_alias_log(gen_email: GenEmail, page_id=0):
when=fel.created_at,
is_reply=fel.is_reply,
blocked=fel.blocked,
bounced=fel.bounced,
)
logs.append(al)
logs = sorted(logs, key=lambda l: l.when, reverse=True)