feat: add /external/api/send_mail for body verify (#202)

This commit is contained in:
Dream Hunter
2024-05-04 23:52:06 +08:00
committed by GitHub
parent 869bf99340
commit 41bed8b1db
5 changed files with 46 additions and 6 deletions

View File

@@ -87,6 +87,7 @@ class CustomSMTPHandler:
_logger.info(f"Parsed mail from {from_name} to {to_mail_map}")
# Send mail
send_body = {
"token": session.auth_data.password.decode(),
"from_name": from_name,
"to_name": to_mail_map.get(to_mail),
"to_mail": to_mail,
@@ -99,9 +100,8 @@ class CustomSMTPHandler:
_logger.info(f"Send mail {send_body}")
try:
res = requests.post(
f"{settings.proxy_url}/api/send_mail",
f"{settings.proxy_url}/external/api/send_mail",
json=send_body, headers={
"Authorization": f"Bearer {session.auth_data.password.decode()}",
"Content-Type": "application/json"
}
)