gigafibre-fsm/scripts
louispaulb 4babb403e8 feat(campaigns): "View in browser" web fallback for failed inbox renders
GET /campaigns/:id/recipients/:i/view re-renders the campaign with the
same vars the worker used at send time — same template, same per-row
amount override, same language pick. Useful when the recipient's mail
client butchers the layout: image-blocking, antique Outlook, niche
third-party apps, accessibility tools.

Templates: Mustache section {{#view_url}}…{{/view_url}} guards a tiny
gray link above the header logo (11px, #94a3b8). The section collapses
to nothing when view_url is empty, so:
  - the /view page itself doesn't show the link (you're already there)
  - wizard previews / test-sends don't show it (no real campaign id)

worker passes view_url = HUB_PUBLIC_URL + /campaigns/<id>/recipients/<i>/view
using the existing cfg.HUB_PUBLIC_URL setting (defaults msg.gigafibre.ca).

Security: campaign-id is a 21-char nanoid (≈10²¹ space). Same level of
exposure as the Giftbit shortlink itself. X-Robots-Tag: noindex on the
response so the URLs don't end up on search engines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 09:30:38 -04:00
..
campaigns feat(campaigns): "View in browser" web fallback for failed inbox renders 2026-05-22 09:30:38 -04:00
migration fix(migration): clean address_line + postal_code + connection_type at import 2026-05-08 15:38:19 -04:00
test refactor: major cleanup — remove dead dispatch app, commit all backend code, extract client composables 2026-04-08 17:38:38 -04:00
bulk_submit.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
fix_ple_groupby.py feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
fix_ple_postgres.sh feat: inline editing, search, notifications + full repo cleanup 2026-03-31 07:34:41 -04:00
import-legacy-accounts.js refactor: reduce token count, DRY code, consolidate docs 2026-04-13 08:39:58 -04:00
server_bulk_submit.py feat: telephony UI, performance indexes, Twilio softphone, lazy-load invoices 2026-04-02 13:59:59 -04:00