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
| Status | Meaning |
|---|---|
| pending | Queued and waiting for the worker. nextRetryAt is due. |
| processing | Claimed by a worker with SKIP LOCKED. Stale claims are recovered after 10 minutes. |
| retrying | A transient failure occurred; a backoff delay is set. |
| sent | SMTP accepted the message. An email_events row records the send. |
| failed | Permanent failure or cancellation. No further attempts. |
| dead_letter | Retries 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.
curl -X POST https://your-formo-host/api/cron/deliver \-H "Authorization: Bearer <CRON_SECRET>"
External scheduler
Sender selection
| Tier | When it is used |
|---|---|
| 1. Form sender | A sender attached to the individual form. Highest priority. |
| 2. Workspace default | One verified sender chosen in /developer/settings. |
| 3. System SMTP | Environment 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
| Symptom | Likely cause |
|---|---|
| Still pending | The worker has not claimed the row yet. Check cron or submit again to trigger instant delivery. |
| Unauthorized cron request | The Authorization header is missing or the Bearer value does not match CRON_SECRET. |
| SMTP handshake failed | Host or credentials are wrong, or the port is blocked. Verify the sender again. |
| SmtpEndpointError | The host resolves to a private or loopback address; the SSRF guard blocks it. |
| Origin is not allowed | Add the exact site origin to the form's allowed origins. |
| No active recipients | The 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.