Ensure success email subject is wired to EMAIL_SUBJECT_SUCCESS and never blank
This commit is contained in:
+5
-9
@@ -164,17 +164,13 @@ def send_success_email(
|
||||
Subject is customizable via EMAIL_SUBJECT_SUCCESS.
|
||||
Falls back to a safe default if the env var is missing or blank.
|
||||
"""
|
||||
subject = _get_subject(
|
||||
"EMAIL_SUBJECT_SUCCESS",
|
||||
"ScrAIbe: Your transcript is ready",
|
||||
)
|
||||
|
||||
# Ensure subject is never blank
|
||||
if not subject.strip():
|
||||
# Read subject from environment; never allow blank
|
||||
subject = (os.getenv("EMAIL_SUBJECT_SUCCESS") or "").strip()
|
||||
if not subject:
|
||||
subject = "ScrAIbe: Your transcript is ready"
|
||||
logger.warning("EMAIL_SUBJECT_SUCCESS was blank; using default subject.")
|
||||
logger.info("EMAIL_SUBJECT_SUCCESS not set or blank; using default subject.")
|
||||
else:
|
||||
logger.info("Using success email subject: %s", subject)
|
||||
logger.info("Using EMAIL_SUBJECT_SUCCESS: %s", subject)
|
||||
|
||||
body = (
|
||||
"Hello,\n\n"
|
||||
|
||||
Reference in New Issue
Block a user