gigafibre-fsm/scripts
louispaulb 2919fa86af feat(campaigns/templates): native-block reminder template (proof of concept)
Until now, every Unlayer-edited template stored as a single giant
"Custom HTML" block (~37 KB). The operator couldn't manipulate the
greeting, the CTA, or the expiry badge independently — they had to
edit raw HTML inside one block.

New scripts/build-native-template.js generates matched .json
(Unlayer design tree) + .html (compiled output) from a JS template
spec under scripts/templates-spec/. Each block becomes a separate
entry in the design tree with its own type:
  - 9 text blocks  : greeting, urgency, body, expiry, prorata,
                     Option 2 text, signature, contact, dark footer
  - 2 image blocks : header logo, footer logo
  - 1 button block : the CTA (🎁 {{amount}})
  - 4 html blocks  : view-in-browser, Option 1 chip, brand-logo
                     card, Option 2 chip (kept as raw HTML — too
                     custom for native equivalents)

gift-email-native-reminder-fr ships as the proof of concept:
- Compiled HTML: 30,867 bytes (vs 39,484 for the MJML-compiled
  reminder-fr — saves 22%)
- JSON: 42,274 bytes (essentially same as before, but now broken into
  16 individually-editable blocks instead of 1 monster Custom HTML)

What this unlocks in Unlayer:
- Click any text → font / color / size / padding / alignment in the
  right panel
- Click the CTA → button-specific controls (corner radius, hover
  color, padding)
- Drag-reorder blocks within the email
- Mobile preview reflects each block's responsive defaults
- Save a block to the personal library for reuse in other campaigns

Limitations on the 4 html blocks:
- Chips (Option 1 / Option 2) require raw HTML edit because the
  rounded badge styling has no native equivalent
- Brand-logo strip needs precise inline img widths Unlayer can't set

Once the operator validates rendering across Gmail/Outlook/Apple
Mail, we'll port the rest: gift-email-fr/en + the existing reminder
templates can all migrate using the same build script.

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

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 15:31:15 -04:00
..
campaigns feat(campaigns/templates): native-block reminder template (proof of concept) 2026-06-01 15:31:15 -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