ucr: annual-renewal reminder campaign + order-alert campaign source

UCR (Unified Carrier Registration) is annual: opens Oct 1, due Dec 31, mandatory
for interstate carriers (op A, same ~628k pool as IFTA) -> recurring revenue.

- build_ucr_annual_campaign.py: 3-touch business-day cadence (30/12/4 bd before
  Dec 31, wider than IFTA since it's once a year), escalating tone, same-day
  coupon, 'I already did it' suppression. Reuses build_trucking_campaigns +
  IFTA business-day/token helpers (DRY). Per-year cycle reset.
- ucr_annual_reminder.html: deadline + fines/OOS risk + 'we figure out your fee
  tier' + coupon + filed link + CAN-SPAM. Source campaign 473.
- migration 096: ucr_reminded_at / ucr_touch_no / ucr_self_filed_at.
- ifta.ts: add GET /api/v1/ucr/filed (shares the HMAC token scheme).
- checkout.ts: order-placement Telegram now shows 'Source: campaign (code X)'
  when a discount code is present, so IFTA/UCR/CLIA conversions are visible.
  (Confirmed order-alert Telegram already fires from handlePaymentComplete for
  all compliance orders via both webhook + session paths.)
This commit is contained in:
justin 2026-06-14 00:30:23 -05:00
parent 2b361a83a8
commit a2665c22c2
5 changed files with 356 additions and 0 deletions

View file

@ -0,0 +1,43 @@
<div style="font-family:-apple-system,system-ui,sans-serif;max-width:600px;margin:0 auto">
<div style="background:#1a2744;padding:24px;text-align:center;border-radius:12px 12px 0 0">
<img src="https://performancewest.net/images/logo.png" alt="Performance West" style="height:40px">
</div>
<div style="background:#fff;border:1px solid #e2e8f0;padding:32px;border-radius:0 0 12px 12px">
<p style="font-size:15px;color:#374151;line-height:1.6">{{ .Subscriber.Attribs.company }},<br>DOT# {{ .Subscriber.Attribs.dot_number }}</p>
<h1 style="font-size:22px;color:#dc2626;margin:16px 0">{{ .Subscriber.Attribs.ucr_headline }}</h1>
<p style="font-size:15px;color:#374151;line-height:1.6">{{ .Subscriber.Attribs.ucr_urgency }}</p>
<p style="font-size:15px;color:#374151;line-height:1.6">Your <strong>{{ .Subscriber.Attribs.ucr_year }} Unified Carrier Registration</strong> is due by <strong>{{ .Subscriber.Attribs.ucr_due_date }}</strong>. If you run interstate, UCR is mandatory. Skip it and you face:</p>
<ul style="font-size:15px;color:#374151;line-height:1.8">
<li><strong>Fines from $100 to $5,000</strong> depending on the state</li>
<li>Being <strong>placed out of service</strong> at the roadside or a weigh station</li>
<li>Held loads and lost revenue while you sort it out</li>
</ul>
{{ if .Subscriber.Attribs.coupon_code }}
<div style="background:#fff7ed;border:2px solid #f97316;border-radius:10px;padding:20px;margin:20px 0;text-align:center">
<p style="font-size:13px;font-weight:700;color:#9a3412;letter-spacing:.04em;margin:0 0 6px">TODAY ONLY - {{ .Subscriber.Attribs.coupon_pct }}% OFF</p>
<p style="font-size:18px;font-weight:700;color:#9a3412;margin:0 0 4px">We file your UCR for <span style="text-decoration:line-through;color:#c2410c;font-weight:600">$39</span> <span style="color:#15803d">$23</span> + the state fee.</p>
<p style="font-size:14px;color:#9a3412;margin:0 0 4px">Use code <strong style="font-size:16px;letter-spacing:.08em">{{ .Subscriber.Attribs.coupon_code }}</strong> at checkout.</p>
<p style="font-size:12px;color:#b91c1c;font-weight:700;margin:0">Expires {{ .Subscriber.Attribs.coupon_expires }}.</p>
</div>
{{ else }}
<div style="background:#f0fdf4;border:2px solid #86efac;border-radius:10px;padding:20px;margin:20px 0;text-align:center">
<p style="font-size:18px;font-weight:700;color:#166534;margin:0 0 4px">We file your UCR for $39 + the state fee.</p>
<p style="font-size:14px;color:#15803d;margin:0">Two minutes of your time, we handle the rest. No portals, no guesswork on your fee tier.</p>
</div>
{{ end }}
<div style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:16px;margin:20px 0">
<p style="font-size:14px;color:#374151;margin:0 0 6px"><strong>We figure out your exact fee tier.</strong></p>
<p style="font-size:13px;color:#64748b;margin:0;line-height:1.6">UCR fees are based on your fleet size, and getting the tier wrong causes rejections and delays. Tell us your power-unit count and we file it correctly the first time, so you stay legal and on the road.</p>
</div>
<div style="text-align:center;margin:24px 0">
<a href="{{ .Subscriber.Attribs.lp_link }}&utm_source=listmonk&utm_medium=email&utm_campaign=ucr-annual@TrackLink" style="display:inline-block;padding:14px 36px;background:#f97316;color:#fff;font-weight:700;border-radius:8px;text-decoration:none;font-size:16px">10-4 - File My UCR Now &rarr;</a>
</div>
<p style="font-size:14px;color:#64748b;line-height:1.6">Or call us directly at <a href="tel:8884110383" style="color:#f97316;font-weight:600">(888) 411-0383</a>.</p>
<div style="text-align:center;margin:18px 0 4px;padding-top:14px;border-top:1px solid #e5e7eb">
<p style="font-size:13px;color:#94a3b8;margin:0 0 6px">Already registered for this year?</p>
<a href="{{ .Subscriber.Attribs.filed_link }}" style="font-size:13px;color:#64748b;text-decoration:underline">I already did it - stop reminding me</a>
</div>
<p style="font-size:14px;color:#64748b">Performance West Inc.<br>DOT Compliance Services</p>
</div>
<div style="text-align:center;padding:16px;font-size:11px;color:#94a3b8"><a href="https://performancewest.net" style="color:#94a3b8">performancewest.net</a> &middot; (888) 411-0383</div><div style="text-align:center;padding:0 16px 18px;font-size:11px;color:#94a3b8;line-height:1.7">Gotta hit a 10-100 and pull off this channel? <a href="{{ UnsubscribeURL }}" style="color:#94a3b8;text-decoration:underline">Unsubscribe here</a>.<br>Performance West Inc. &middot; 525 Randall Ave Ste 100-1195, Cheyenne, WY 82001</div>
</div>