From 7c79cc9a08c1f329b9f2f09698bb18a112ae9d34 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 2 Jun 2026 21:37:01 -0500 Subject: [PATCH] DOT D&A delivery email: point CTA + body to the customer portal The instant-delivery email told customers to 'just reply to this email' with no way to view/manage their order. Add a portal line in the body and change the CTA to 'View in Portal' pointing at PORTAL_URL (portal.performancewest.net), matching delivery_worker/renewal_worker conventions. Add _site_url()/_portal_url() helpers. --- scripts/workers/job_server.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/workers/job_server.py b/scripts/workers/job_server.py index 68db1ce..4066fcb 100644 --- a/scripts/workers/job_server.py +++ b/scripts/workers/job_server.py @@ -44,6 +44,16 @@ logging.basicConfig( PORT = int(os.getenv("WORKER_PORT", "8090")) MAX_WORKERS = int(os.getenv("MAX_WORKERS", "3")) + +def _site_url() -> str: + """Public site base URL for customer-facing links (no trailing /).""" + return os.getenv("SITE_URL", "https://performancewest.net").rstrip("/") + + +def _portal_url() -> str: + """Customer portal base URL where clients view orders (no trailing /).""" + return os.getenv("PORTAL_URL", "https://portal.performancewest.net").rstrip("/") + # Job tracking active_jobs: dict[str, dict] = {} completed_jobs: list[dict] = [] # Last 100 completed @@ -858,8 +868,10 @@ def _send_instant_delivery( "Section 8.", "Because it is a Word file, you and your attorney can edit it " "freely to match your operation.", - "Questions or need a correction? Just reply to this email or " - "contact us at info@performancewest.net — " "we'll help right away at no additional charge.", "This fee is tax " @@ -867,8 +879,8 @@ def _send_instant_delivery( "", "— Performance West Compliance Team", ] - cta_text = "Manage My DOT Compliance" - cta_url = "https://performancewest.net/services/dot-drug-alcohol" + cta_text = "View in Portal \u2192" + cta_url = _portal_url() headline = "Your DOT Drug & Alcohol Compliance Binder is ready" else: body_parts = [