From 93e20ca83ffab688dca0431da6896b12700ca539 Mon Sep 17 00:00:00 2001 From: sanj <67624670+iodrift@users.noreply.github.com> Date: Wed, 10 Jul 2024 10:27:18 -0700 Subject: [PATCH] Auto-update: Wed Jul 10 10:27:18 PDT 2024 --- sijapi/routers/email.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sijapi/routers/email.py b/sijapi/routers/email.py index 6707e91..d7c8b3b 100644 --- a/sijapi/routers/email.py +++ b/sijapi/routers/email.py @@ -100,7 +100,7 @@ async def send_response(to_email: str, subject: str, body: str, profile: AutoRes L.DEBUG(f"Sending auto-response to {to_email} concerning {subject} from account {profile.name}...") - server = get_smtp_connection(profile) + server = get_smtp_connection(profile.smtp) L.DEBUG(f"SMTP connection established: {type(server)}") server.login(profile.smtp.username, profile.smtp.password) server.send_message(message) @@ -108,7 +108,6 @@ async def send_response(to_email: str, subject: str, body: str, profile: AutoRes L.INFO(f"Auto-response sent to {to_email} concerning {subject} from account {profile.name}!") return True - except Exception as e: L.ERR(f"Error in preparing/sending auto-response from account {profile.name}: {str(e)}") L.ERR(f"SMTP details - Host: {profile.smtp.host}, Port: {profile.smtp.port}, Encryption: {profile.smtp.encryption}") @@ -123,6 +122,7 @@ async def send_response(to_email: str, subject: str, body: str, profile: AutoRes L.ERR(f"Error closing SMTP connection: {str(e)}") + def clean_email_content(html_content): soup = BeautifulSoup(html_content, "html.parser") return re.sub(r'[ \t\r\n]+', ' ', soup.get_text()).strip()