Skip to content
You're viewing documentation for v1.2.0. It may be out of date.Go to latest
Email SDK
Esc
↑↓navigate↵open⌘Jpreview
On this page

Send and track email

Queue email from Convex mutations, expose reactive status, and inspect the complete event timeline.

Queue from a mutation

send writes the queue record in the calling mutation’s transaction and returns its component id. If the outer mutation rolls back, the email is not queued. Provider delivery starts after the transaction commits.

Use a stable idempotency key for every user-visible message that application code may enqueue again. Reusing the key returns the existing email id.

Expose reactive status

Component functions are not directly callable from a browser. Wrap the query in your app and apply the same authorization rules as the related application data.

A subscribed client updates as the record moves through queued, processing, sent, failed, or canceled. Webhooks add deliveryStatus values delivered, bounced, or complained without discarding queue history.

Understand the two status layers

Field Meaning
status Whether the component queued and handed the message to a provider.
deliveryStatus What a provider webhook later reported about mailbox delivery.
attemptedAdapters Every named adapter attempted across the current record.
providerMessageId The provider receipt used to correlate webhook events.
lastError The last component send failure, if the send is retrying or terminal.
nextAttemptAt When the next automatic retry becomes eligible.

A sent queue status is not proof of inbox delivery. Treat webhook-backed delivered as the positive delivery signal.

Batch enqueue

sendBatch accepts at most 100 messages per mutation and returns ids in input order. Duplicate idempotency keys within the batch resolve to the same stored email.

Cancel before processing

Cancellation returns true only while the record is still queued. It cannot recall a provider request that already started.

Process webhooks

Turn provider events into normalized delivery state.

Test and recover

Inspect failures and start a safe manual retry.

Last updated on