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.
|
Subject is customizable via EMAIL_SUBJECT_SUCCESS.
|
||||||
Falls back to a safe default if the env var is missing or blank.
|
Falls back to a safe default if the env var is missing or blank.
|
||||||
"""
|
"""
|
||||||
subject = _get_subject(
|
# Read subject from environment; never allow blank
|
||||||
"EMAIL_SUBJECT_SUCCESS",
|
subject = (os.getenv("EMAIL_SUBJECT_SUCCESS") or "").strip()
|
||||||
"ScrAIbe: Your transcript is ready",
|
if not subject:
|
||||||
)
|
|
||||||
|
|
||||||
# Ensure subject is never blank
|
|
||||||
if not subject.strip():
|
|
||||||
subject = "ScrAIbe: Your transcript is ready"
|
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:
|
else:
|
||||||
logger.info("Using success email subject: %s", subject)
|
logger.info("Using EMAIL_SUBJECT_SUCCESS: %s", subject)
|
||||||
|
|
||||||
body = (
|
body = (
|
||||||
"Hello,\n\n"
|
"Hello,\n\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user