refactor(worker): Brevo+EmailJS ? Resend + remove cron + fix github.io URLs #3

Merged
serge merged 2 commits from feat/cloudflare-worker-resend-migration into main 2026-05-07 15:27:41 +03:00
Owner

Summary

Migrates the contact form Cloudflare Worker from Brevo+EmailJS to Resend (already used by m4s-auth in production).

Why

  • Serge has no access to the current Cloudflare account (Melissa)
  • Fresh CF account being provisioned in Phase D
  • Resend API key already deployed for m4s-auth

Changes

  • Worker code: Brevo ? Resend HTTP API
  • Cron removed: */5 * * * * EmailJS scheduled handler deleted (eliminates double-send race window)
  • 3 hardcoded URLs fixed: github.io ? mva-globalfret.com
  • Adds wrangler.toml (placeholder KV id, secrets list, no triggers)

?? DO NOT MERGE until Phase D Cloudflare fresh provision is complete.

Refs: WordPress ? static migration plan, Phase B PR #3a.

## Summary Migrates the contact form Cloudflare Worker from Brevo+EmailJS to Resend (already used by m4s-auth in production). ## Why - Serge has no access to the current Cloudflare account (Melissa) - Fresh CF account being provisioned in Phase D - Resend API key already deployed for m4s-auth ## Changes - Worker code: Brevo ? Resend HTTP API - Cron removed: */5 * * * * EmailJS scheduled handler deleted (eliminates double-send race window) - 3 hardcoded URLs fixed: github.io ? mva-globalfret.com - Adds wrangler.toml (placeholder KV id, secrets list, no triggers) ## ?? DO NOT MERGE until Phase D Cloudflare fresh provision is complete. Refs: WordPress ? static migration plan, Phase B PR #3a.
serge added 1 commit 2026-05-07 01:11:38 +03:00
- Replace Brevo HTTP API calls with Resend (api.resend.com/emails) — aligns with m4s-auth Phase 2.1 SMTP provider
- Remove scheduled handler and processWelcomeQueue (EmailJS cron */5 * * * *)
  → eliminates double-send race window identified in Phase 2 audit
- Rename sendWelcomeViaBrevo → sendWelcomeViaResend
- Fix 3 hardcoded GH Pages URLs (lines ~234, ~541, ~600) → mva-globalfret.com fallback
- Add wrangler.toml: KV binding placeholder, no [triggers] cron, secrets list
- Update DEPLOIEMENT.md: env vars list (Resend in, Brevo+EmailJS out)

DO NOT MERGE until new Cloudflare account + Worker deployment Phase D ready
(merge écarterait l'ancien Worker Melissa actif si on revenait dessus).

Refs: WordPress → static migration plan, Phase B PR #3a.
serge added 1 commit 2026-05-07 15:25:33 +03:00
- wrangler.toml: workers_dev=true (= explicit routing on *.workers.dev)
- wrangler.toml: real KV ID c02656ba2206... after `wrangler kv namespace create WELCOME_KV`
- hubspot-proxy.js getNextRef: guard `!res.ok` before res.json() to surface HubSpot errors
- .gitignore: ignore .wrangler/ local cache dir

Discovered during Phase D2-D3 deploy + smoke testing.

Refs: WordPress \xe2\x86\x92 static migration plan, Phase B PR #3a.
serge merged commit 483195711e into main 2026-05-07 15:27:41 +03:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: serge/site-mva-global-fret#3
No description provided.