Documentation

Delivery

How submissions become email, and what to do when they do not.

One pipeline

Form notifications and non-developer broadcasts both become rows in email_deliveries. There is no second SMTP path. The public submission route only validates and persists data; all sending happens in runDeliveryBatch().

Delivery lifecycle

StatusMeaning
pendingQueued and waiting for the worker. nextRetryAt is due.
processingClaimed by a worker with SKIP LOCKED. Stale claims are recovered after 10 minutes.
retryingA transient failure occurred; a backoff delay is set.
sentSMTP accepted the message. An email_events row records the send.
failedPermanent failure or cancellation. No further attempts.
dead_letterRetries exhausted after five attempts.

Instant and scheduled sending

After a successful submission accepts its response, FormO runs a small batch of the same worker via Next.js after(). A visitor normally sees success within seconds. The scheduled endpoint remains the safety net for retries and rows left behind.

bash
curl -X POST https://your-formo-host/api/cron/deliver \
-H "Authorization: Bearer <CRON_SECRET>"

External scheduler

Vercel Hobby only allows daily cron schedules. Use an external scheduler that can call this endpoint every minute, or accept that pending rows wait for the daily tick. Keep CRON_SECRET out of client code.

Sender selection

TierWhen it is used
1. Form senderA sender attached to the individual form. Highest priority.
2. Workspace defaultOne verified sender chosen in /developer/settings.
3. System SMTPEnvironment variables, used when neither above is set.

A sender must be verified before it can be assigned as a workspace default or to a form. Verification checks the SMTP handshake only; see Quickstart for setup.

Retries and dead letter

Transient errors retry at 1, 5, 30, 120 and 360 minutes. Permanent errors — invalid recipients, SMTP 550-class responses or blocked endpoints — stop immediately. After five attempts a row becomes dead_letter. The worker caps each run at 50 seconds and 25 rows, so a large backlog is processed in batches.

Troubleshooting

SymptomLikely cause
Still pendingThe worker has not claimed the row yet. Check cron or submit again to trigger instant delivery.
Unauthorized cron requestThe Authorization header is missing or the Bearer value does not match CRON_SECRET.
SMTP handshake failedHost or credentials are wrong, or the port is blocked. Verify the sender again.
SmtpEndpointErrorThe host resolves to a private or loopback address; the SSRF guard blocks it.
Origin is not allowedAdd the exact site origin to the form's allowed origins.
No active recipientsThe form has no recipients and no emailTo address.

Frequently asked questions

How does FormO deliver form emails?

Form notifications and non-developer broadcasts both become rows in email_deliveries and go through one SMTP pipeline. The public submission route only validates and persists data; all sending happens in runDeliveryBatch().

Is email delivery instant?

After a successful submission, FormO runs a small batch of the same worker via Next.js after(), so a visitor normally sees success within seconds. A scheduled endpoint remains the safety net for retries and rows left behind.

How many times does FormO retry a failed email?

Retries are exhausted after five attempts, after which the row enters dead_letter. Transient failures get a backoff delay before the next attempt; permanent failures stop immediately.

Which SMTP sender does FormO use?

FormO first uses a sender attached to the form, then the workspace default, then system SMTP environment variables. A sender must be verified before it can be assigned to a form or set as default.