Set trucking campaign Reply-To header

This commit is contained in:
justin 2026-06-03 23:35:28 -05:00
parent ef79e85b41
commit f42833cc9d
2 changed files with 6 additions and 0 deletions

View file

@ -151,6 +151,8 @@ 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}]
USABLE_FILTER = (
"(email_verified IS TRUE OR email_verify_result IN "
@ -258,6 +260,7 @@ def create_and_schedule_campaign(
"template_id": base["template_id"],
"tags": base.get("tags") or [],
"messenger": base.get("messenger") or "email",
"headers": base.get("headers") or REPLY_TO_HEADERS,
}
if schedule:
payload["send_at"] = send_at_utc.strftime("%Y-%m-%dT%H:%M:%S+00:00")
@ -301,6 +304,7 @@ def send_test(base: dict, campaign_id: int, sample_row: tuple, label: str, tz: s
"body": body, "altbody": base.get("altbody"),
"template_id": base["template_id"],
"tags": base.get("tags") or [], "messenger": base.get("messenger") or "email",
"headers": base.get("headers") or REPLY_TO_HEADERS,
"subscribers": [TEST_EMAIL],
}
try:

View file

@ -30,6 +30,7 @@ from scripts import build_trucking_campaigns as b # reuse lm_api + auth + segme
FROM_EMAIL = "Performance West <noreply@performancewest.net>"
TEMPLATE_ID = 6 # same wrapper template as the MCS-150 source campaign
SOURCE_LIST_ID = 8 # same placeholder list used by the MCS-150/inactive source drafts
REPLY_TO = "info@performancewest.net"
PHONE = "(888) 411-0383"
PHONE_TEL = "8884110383"
@ -233,6 +234,7 @@ def create_draft(seg_key: str, cfg: dict, dry: bool) -> int | None:
"template_id": TEMPLATE_ID,
"tags": ["trucking", "deficiency", "source"],
"messenger": "email",
"headers": [{"name": "Reply-To", "value": REPLY_TO}],
}
res = b.lm_api("/campaigns", payload, "POST")
cid = res["data"]["id"]