Appearance
vela-mail-smoke
A throwaway Cloudflare Worker that exercises every @velapay/mail template against the real Cloudflare Email Service before a release ships. Originally created during Phase 49 (D-14 verification window) and intentionally short-lived — deploy, smoke-test every template, delete.
Purpose and Role
- Verify that every
vela-mailtemplate still renders and dispatches against the production transport. - Catch breakage that local Mailpit testing can't surface (CF Email rejection, allowed-sender mismatches, binding misconfiguration, content-type issues).
- Run end-to-end without dragging in the dashboard's full Worker — just
vela-mail+ a thin HTTP shim that selects a template by name. - Be deletable on demand once a release passes.
Tech Stack
| Technology | Version | Purpose |
|---|---|---|
| TypeScript | ^5.8.x | Language |
| Bun | 1.3.x | Package manager / dev runtime |
@vela/mail | local link | Template + transport |
| Cloudflare Workers | — | Hosting (real send_email bindings) |
| wrangler | latest | Deploy + delete |
Worker Surface
GET /send?to=<email>&type=<template-id>Selects a vela-mail template by name and dispatches it to the requested recipient using the production send_email binding. Allowed-sender bindings configured in wrangler.toml:
| Binding | Allowed sender |
|---|---|
AUTH_EMAIL | mail@velapay.io |
BILLING_EMAIL | billing@velapay.io |
Directory Structure
vela-mail-smoke/
├── src/
│ └── index.ts # GET /send dispatch shim
├── wrangler.toml # CF Email bindings + sender allowlist
├── package.json
└── tsconfig.jsonOperational Workflow
1. bun install
2. wrangler deploy # ships throwaway worker
3. bun run send:auth # smoke-tests auth.verification template
4. bun run send:invoice # smoke-tests invoice template
(repeat for each new or changed template)
5. visually confirm receipt at $SMOKE_TO
6. wrangler delete --name vela-mail-smoke # tear down post-verificationThe npm scripts wrap the curl calls so the smoke flow is a single bun command per template.
Notable Design Decisions
Throwaway by Design
This is not a continuously-deployed surface. The wrangler.toml opening comment is explicit: "THROWAWAY Worker — Phase 49 smoke verification (D-14). DELETE post-verification." Keeping it deployed long-term would (a) accumulate sender quota, (b) create a long-lived ingress on the Cloudflare account, and (c) drift from the actual vela-mail consumer surfaces. Each release that touches templates redeploys it.
Real Transport, Real Senders
Mailpit is fine for local-dev visual review but doesn't catch CF Email rejection or allowlist misconfiguration. This worker uses production senders (mail@velapay.io, billing@velapay.io) so issues that only manifest with real DKIM/SPF/DMARC paths surface here.
One-Recipient Test
The smoke flow targets a single human recipient (SMOKE_TO). Bulk testing isn't the goal — visual confirmation that the rendered email looks right and lands in the inbox is.
Related
- Templates and transport: vela-mail →
- Release verification matrix: Verification Matrix →