(20241203) Mail sync'ing started. You can now hit a dedicated API endpoint to trigger a mail-sync process (in the background if you want) and save the mails to your database.
This commit is contained in:
@@ -156,16 +156,19 @@ def parse(raw_mail: str | bytes) -> Dict[str, Any]:
|
||||
# Put everything together:
|
||||
return {
|
||||
"ts": date_time.to_timezone(parsed_mail.date, timezone = date_time.TIMEZONE_UTC),
|
||||
"readTs": date_time.get_current_utc_date_time(as_string = False),
|
||||
"headers": parsed_mail.headers,
|
||||
"from": [{"name": _[0] or _[1], "email": _[1]} for _ in parsed_mail.headers["From"]],
|
||||
"to": [{"name": _[0] or _[1], "email": _[1]} for _ in parsed_mail.headers["To"]],
|
||||
"cc": [{"name": _[0] or _[1], "email": _[1]} for _ in parsed_mail.headers.get("Cc", [])],
|
||||
"bcc": [{"name": _[0] or _[1], "email": _[1]} for _ in parsed_mail.headers.get("Bcc", [])],
|
||||
"subject": parsed_mail.headers["Subject"],
|
||||
"text": parsed_mail.text_plain,
|
||||
"html": parsed_mail.text_html,
|
||||
"parts": parts,
|
||||
"unformattedText": "\n".join(unformatted_text),
|
||||
"attachments": message_attachments,
|
||||
"isInbox": None
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user