generated from nathanwoodburn/python-webserver-template
feat: Add e.hns.au email domain
All checks were successful
Build Docker / BuildImage (push) Successful in 52s
All checks were successful
Build Docker / BuildImage (push) Successful in 52s
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user