From 5c6f049fb48befbbdf2213298a45c7452daf9bd5 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 9 Oct 2024 15:59:50 +1100 Subject: [PATCH] feat: Add e.hns.au email domain --- server.py | 7 ++++--- templates/inbox.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 9b89e5d..8909034 100644 --- a/server.py +++ b/server.py @@ -370,7 +370,8 @@ def get_user(token): @cache -def get_email(email): +def get_email(email:str): + altemail:str = f"{email.split('@')[0]}@e.hns.au" params = { "embed": "threads", "mailboxId": os.getenv("FREESCOUT_MAILBOX"), @@ -396,10 +397,10 @@ def get_email(email): for conversation in conversations["_embedded"]["conversations"]: addresses = conversation["cc"] for address in addresses: - if address == email: + if address == email or address == altemail: threads.append(parse_email(conversation)) - return {"email": email, "conversations": threads} + return {"email": email, "emailalt": altemail,"conversations": threads} @cache diff --git a/templates/inbox.html b/templates/inbox.html index cba8ac0..7666511 100644 --- a/templates/inbox.html +++ b/templates/inbox.html @@ -12,7 +12,7 @@
-

HNS Email

  {{emails.email}} | Notifications | HNS Email  {{emails.email}} {{emails.emailalt}} | Notifications | Logout