diff --git a/scripts/build_trucking_campaigns.py b/scripts/build_trucking_campaigns.py index 975772a..a2c6bbb 100644 --- a/scripts/build_trucking_campaigns.py +++ b/scripts/build_trucking_campaigns.py @@ -554,7 +554,13 @@ TIMEZONE_CONFIG = { # Owner email — test sends go here before each campaign is scheduled TEST_EMAIL = os.getenv("CAMPAIGN_TEST_EMAIL", "carrierone@gmx.com") REPLY_TO_EMAIL = os.getenv("CAMPAIGN_REPLY_TO", "info@performancewest.net") -REPLY_TO_HEADERS = [{"name": "Reply-To", "value": REPLY_TO_EMAIL}] +# Listmonk applies campaign headers as `for hdr, val := range set { h.Add(hdr, val) }` +# (internal/manager/manager.go), i.e. each map's KEY is the literal header name. +# So the correct shape is {"Reply-To": value}; a {"name": ..., "value": ...} map +# would emit junk "name:"/"value:" headers and NO real Reply-To, silently sending +# replies to the From address (noreply@send.performancewest.net) instead. The +# healthcare builder already uses the correct shape; match it here. +REPLY_TO_HEADERS = [{"Reply-To": REPLY_TO_EMAIL}] # Bulk From — sends from the dedicated bulk subdomain so its sending reputation # is isolated from the root domain (which stays clean for transactional / diff --git a/scripts/create_deficiency_source_campaigns.py b/scripts/create_deficiency_source_campaigns.py index 2f73079..a232d37 100644 --- a/scripts/create_deficiency_source_campaigns.py +++ b/scripts/create_deficiency_source_campaigns.py @@ -307,7 +307,7 @@ def update_existing_campaign(campaign_id: int, cfg: dict, body: str, dry: bool) "template_id": existing.get("template_id") or TEMPLATE_ID, "tags": existing.get("tags") or ["trucking", "deficiency", "source"], "messenger": existing.get("messenger") or "email", - "headers": existing.get("headers") or [{"name": "Reply-To", "value": REPLY_TO}], + "headers": existing.get("headers") or [{"Reply-To": REPLY_TO}], } if dry: print(f" [{cfg['env']}] DRY-RUN would update source campaign {campaign_id} (body {len(body)} chars)") @@ -340,7 +340,7 @@ def create_draft(seg_key: str, cfg: dict, dry: bool, update_existing: bool = Fal "template_id": TEMPLATE_ID, "tags": ["trucking", "deficiency", "source"], "messenger": "email", - "headers": [{"name": "Reply-To", "value": REPLY_TO}], + "headers": [{"Reply-To": REPLY_TO}], } res = b.lm_api("/campaigns", payload, "POST") cid = res["data"]["id"] diff --git a/scripts/workers/create_compliance_campaign.py b/scripts/workers/create_compliance_campaign.py index f89637c..aa0f583 100644 --- a/scripts/workers/create_compliance_campaign.py +++ b/scripts/workers/create_compliance_campaign.py @@ -251,7 +251,7 @@ def create_campaign(): "content_type": "html", "body": campaign_html, "status": "draft", - "headers": [{"key": "Reply-To", "value": "info@performancewest.net"}], + "headers": [{"Reply-To": "info@performancewest.net"}], }, timeout=30) if not r.ok: