FlaresendDocs

Statuses and events

What each email and recipient status means, how they change, and the timeline events behind them.

Every email has a status, every recipient of it has its own recipient status, and every change is written to the email's timeline as an event. You read all three with Retrieve an email, and webhooks push the events to you as they happen.

Accepted
queuedOn the send queue
scheduledWaiting for scheduledAt
testSent with a test key. Never delivered
In flight
sendingPicked up by the queue
sentHanded to Cloudflare
deferredReceiving server asked to retry later
Final
deliveredEvery recipient accepted it
bouncedA recipient bounced
complainedA recipient marked it as spam
rejectedRefused before delivery
failedCould not be sent
canceledScheduled email canceled

Email statuses

StatusMeaning
queuedAccepted and on the send queue.
scheduledWaiting for its scheduledAt time. See Scheduling.
testSent with an fs_test_ key. Recorded, never sent. See Test mode.
sendingThe queue picked it up and is handing it to Cloudflare.
sentCloudflare accepted it. cloudflareMessageId and sentAt are set.
deferredA receiving server asked Cloudflare to try again later. Usually becomes delivered.
deliveredEvery recipient's server accepted it.
bouncedAt least one recipient bounced.
complainedAt least one recipient marked it as spam.
rejectedRefused before delivery, for example because Cloudflare's own suppression list has the address.
failedCould not be sent: a permanent error from Cloudflare, retries ran out, or it couldn't be queued. lastError says why.
canceledA scheduled email that was canceled.

How the email status is worked out

Cloudflare reports delivery per recipient, so the email status is computed from its recipients each time one changes. The first rule that matches wins:

  1. Any recipient complained → complained
  2. Any recipient bounced → bounced
  3. Any recipient rejected → rejected
  4. Any recipient failed → failed
  5. Every recipient delivered → delivered
  6. Any recipient deferred → deferred

Two rules keep the status from going backwards:

  • An email with a failure status never goes back to sent, deferred or delivered.
  • A lower failure never replaces a higher one. The order is complained > bounced > rejected > failed.

So an email to two people where one bounced and one was delivered is bounced. Check recipients for each person's result.

deliveredAt and failedAt are set the first time the email reaches delivered or a failure status.

Recipient statuses

Each entry in recipients has address, kind (to, cc or bcc), status, and the delivery details Cloudflare reported: provider, smtpStatus, smtpResponse, deliveryMs, bounceType and lastEventAt.

Recipient statuses are queued, sent, deferred, delivered, bounced, complained, rejected, failed, test and canceled.

Events can arrive late or out of order. A new status only replaces the current one if it ranks at least as high:

RankStatus
0queued, sent, test
1deferred
2delivered
3failed, rejected
4bounced
5complained

A late deferred never overwrites delivered. A complaint after delivery does replace delivered, because it ranks higher.

Timeline events

EventWritten whenWebhook
email.queuedThe email was accepted and queued.yes
email.scheduledThe email was accepted with scheduledAt, or rescheduled.no
email.testThe email was recorded with a test key.no
email.sentCloudflare accepted the message.yes
email.retryingSending hit a temporary error and will be retried. Data has code, attempt and delaySeconds.no
email.deferredA recipient's server deferred it.yes
email.deliveredA recipient's server accepted it.yes
email.bouncedA recipient bounced.yes
email.complainedA recipient complained.yes
email.rejectedDelivery to a recipient was refused.yes
email.failedThe email or a recipient failed permanently.yes
email.canceledA scheduled email was canceled.yes
email.openedThe first open. See Tracking.yes
email.clickedA tracked link was clicked.yes

Delivery events (delivered, deferred, bounced, complained, rejected, failed from Cloudflare) are per recipient: an email to three people gets up to three email.delivered events, each with recipient set. Events Flaresend writes itself (queued, sent, retrying, canceled, opened, clicked) have recipient: null.

List events across all emails with List events, for example GET /v1/events?type=email.bounced.

Sending retries

Once an email is on the queue, a temporary error from Cloudflare (E_RATE_LIMIT_EXCEEDED, E_INTERNAL_SERVER_ERROR, E_DELIVERY_FAILED) or a network error is retried with exponential backoff: min(2^attempt × 15 s, 1 hour) plus up to 20% random jitter, up to 8 retries. Each retry writes an email.retrying event. After the last one, the email is marked failed.

Other errors fail at once. E_RECIPIENT_SUPPRESSED from Cloudflare marks the email rejected and adds its recipients to Flaresend's suppression list.

Automatic suppressions

When a recipient hard-bounces or complains, Flaresend adds the address to the suppression list, and later sends to it are refused with 422 recipient_suppressed. See Suppressions.

Stuck at sent?

If emails stay at sent forever, the mailer isn't receiving Cloudflare's delivery events. Check the event subscription for the sending domain. See Troubleshooting.

On this page