Use logo1.png in emails, inline mail_style.css, attach summary as MD
This commit is contained in:
+11
-3
@@ -39,7 +39,7 @@ def get_queue_position(task_id: str) -> int:
|
||||
def send_initial_email(to: str, queue_pos: int):
|
||||
"""
|
||||
Send initial confirmation email with queue position using HTML template.
|
||||
Static placeholders (contact_email, css_path) come from env via load_template.
|
||||
Static placeholders (contact_email, css, logo) come from env via load_template.
|
||||
"""
|
||||
subject = "ScrAIbe: Your transcription request has been received"
|
||||
|
||||
@@ -89,7 +89,7 @@ def send_success_email(
|
||||
):
|
||||
"""
|
||||
Send final email with transcript and attachments using HTML template.
|
||||
Static placeholders (contact_email, css_path) come from env via load_template.
|
||||
Static placeholders (contact_email, css, logo) come from env via load_template.
|
||||
"""
|
||||
subject = "ScrAIbe: Your transcript is ready"
|
||||
|
||||
@@ -141,7 +141,7 @@ def send_success_email(
|
||||
def send_error_email(to: str, error_message: str, task_id: str):
|
||||
"""
|
||||
Send error notification email using HTML template.
|
||||
Static placeholders (contact_email, css_path) come from env via load_template.
|
||||
Static placeholders (contact_email, css, logo) come from env via load_template.
|
||||
"""
|
||||
subject = "ScrAIbe: Error with your transcription request"
|
||||
|
||||
@@ -271,6 +271,14 @@ def process_transcription_task(
|
||||
json.dump(json_data, f, indent=2, ensure_ascii=False)
|
||||
attachments.append(json_path)
|
||||
|
||||
# MD summary (only when summary is available)
|
||||
if summary_text:
|
||||
md_path = tempfile.mktemp(suffix=".md")
|
||||
with open(md_path, "w", encoding="utf-8") as f:
|
||||
f.write("# Summary\n\n")
|
||||
f.write(summary_text)
|
||||
attachments.append(md_path)
|
||||
|
||||
# 5) Send success email
|
||||
send_success_email(
|
||||
to=email_to,
|
||||
|
||||
Reference in New Issue
Block a user