diff --git a/scripts/build_healthcare_campaigns.py b/scripts/build_healthcare_campaigns.py index f234838..4edd491 100644 --- a/scripts/build_healthcare_campaigns.py +++ b/scripts/build_healthcare_campaigns.py @@ -1,28 +1,30 @@ #!/usr/bin/env python3 -"""Healthcare (NPI/Medicare) marketing emails, segmented by the compliance -problem that needs correcting. Mirrors the trucking brand shell -(scripts/campaign_template.html) so all PW outbound looks consistent. +"""Healthcare (NPI/Medicare) marketing-email SEGMENT REGISTRY + test tooling. -Each segment maps to a real PW service + order page: +SINGLE SOURCE OF TRUTH for the healthcare campaign segments. Each segment maps a +compliance problem to a real PW service, its order page, price, the listmonk +list/campaign it warms, and the canonical HTML template under data/hc_campaigns/. - revalidation_overdue Medicare PECOS Revalidation Filing ($599) /order/npi-revalidation - npi_reactivation NPI Reactivation ($449) /order/npi-reactivation - nppes_outdated NPPES Data Update / Attestation ($349) /order/nppes-update - oig_screening OIG/SAM Exclusion Screening ($299) /order/oig-sam-screening - compliance_bundle Provider Compliance Bundle (annual) ($899) /order/provider-compliance-bundle +The HTML bodies themselves are the hand-tuned, deployed templates in +data/hc_campaigns/hc_.html (teal header, per-segment "verify it yourself" +trust block, official-record card on revalidation, etc.). This module does NOT +regenerate them -- it READS them, so the files stay the one source of truth and +can't drift from a parallel generator. (An earlier version of this script kept a +divergent inline generator; that was removed.) -Two uses: - * `--render ` -> writes the listmonk campaign HTML to out/. - * `--send-test ` -> sends every segment as a real test through the - healthcare HOT SMTP stream (host :2526 -> hcout1 -> .107), so you see exactly +Consumers: + * build_healthcare_campaigns_cron.py imports SEGMENTS to warm every segment. + * `--send-test ` sends every segment as a real test through the + healthcare HOT SMTP stream (host :2526 -> hcout1 -> .107) so you see exactly what a provider receives. Personalization tokens are filled with sample data. -Listmonk personalization tokens used (kept identical to trucking so the same -subscriber-attribs convention applies on real sends): +Listmonk personalization tokens used on real sends (filled from subscriber +attribs by listmonk; filled from SAMPLE here for test sends): {{ .Subscriber.Name }} provider / practice name {{ .Subscriber.Attribs.npi }} NPI {{ .Subscriber.Attribs.practice }} practice / org name {{ .Subscriber.Attribs.detail }} segment-specific detail (e.g. due date) + {{ .Subscriber.Attribs.reval_due_date }} / .days_overdue (revalidation card) {{ UnsubscribeURL }} listmonk per-subscriber unsubscribe """ from __future__ import annotations @@ -38,105 +40,60 @@ FROM_EMAIL = "compliance@performancewest.net" REPLY_TO = "info@performancewest.net" OUT_DIR = os.path.join(os.path.dirname(__file__), "..", "data", "hc_campaigns") -# ── Per-segment content ──────────────────────────────────────────────────── +# ── Per-segment registry ─────────────────────────────────────────────────── +# Metadata only. The email body lives in OUT_DIR/