Ensure success email subject is never blank; add final guard in send_email
This commit is contained in:
@@ -221,7 +221,13 @@ def send_email(
|
||||
msg["To"] = ", ".join(to_list)
|
||||
if cc_list:
|
||||
msg["Cc"] = ", ".join(cc_list)
|
||||
msg["Subject"] = subject
|
||||
|
||||
# Ensure subject is never blank
|
||||
if not subject or not subject.strip():
|
||||
logger.warning("Subject was blank; using default subject.")
|
||||
subject = "ScrAIbe: Your transcript is ready"
|
||||
|
||||
msg["Subject"] = subject.strip()
|
||||
|
||||
# Attach plain text
|
||||
msg.attach(MIMEText(body, "plain"))
|
||||
|
||||
Reference in New Issue
Block a user