Email: Inbox + Outbox

Send and receive email in Convex via Resend or Amazon SES with parsed inbound mail, threading, suppression, and delivery tracking in one component.

Installation

npm install @sayedhfatimi/convex-email

About Email: Inbox + Outbox

convex-email adds full-duplex email to a Convex backend through a single `Email` client class. Inbound messages from Resend or Amazon SES are parsed, deduplicated, SPF/DKIM/DMARC-verified, threaded by In-Reply-To, and stored in Convex file storage with an `onInbound` mutation hook. Outbound mail is queued in an outbox with background retries, suppression tracking for hard bounces and complaints, RFC 8058 one-click unsubscribe headers, and delivery event callbacks.

Benefits

Use cases

how to receive inbound email in a Convex app

The @sayedhfatimi/convex-email component exposes an onInbound hook that receives each parsed, verified, and de-duplicated message as a normalized object in a Convex mutation. It supports Resend receiving, AWS SES receipt rules, and raw MIME input. Attachments and bodies go to Convex file storage automatically.

how to build a support desk with reply-by-email in Convex

convex-email threads replies to their parent messages, records whether the sender was an original recipient, and exposes parent message metadata including tags. Combined with the onInbound hook and mail.send for outbound replies, it provides the primitives needed for a support desk with reply-by-email, as documented in the included guides.

how to track email delivery events in Convex

The @sayedhfatimi/convex-email component stores sent, delivered, bounced, complained, and other delivery events directly on the message record. An optional onEvent hook lets your Convex mutation react to each status change, giving you a queryable delivery audit trail without a separate webhook handler.

how to suppress hard bounces and handle unsubscribes for email in Convex

convex-email automatically suppresses addresses that produce hard bounces or complaints, blocking future sends to those addresses. It also generates RFC 8058 List-Unsubscribe headers with signed links per category, and an optional onUnsubscribe hook notifies your application when a recipient opts out.

Frequently asked questions

Which email providers does @sayedhfatimi/convex-email support?

@sayedhfatimi/convex-email supports Resend and Amazon SES for both sending and receiving. You can switch the active send provider by changing the sendVia config value. Suppressions, unsubscribes, and thread history persist across provider switches. The component has been tested live against both providers.

Does convex-email run in the Convex Node.js runtime or the default runtime?

convex-email runs entirely in Convex's default runtime and contains no files marked 'use node'. HTML cleaning, SNS signature verification, and SigV4 request signing all use runtime-neutral libraries, which is required because Convex components cannot include Node.js-only files.

How does convex-email handle credentials for multi-tenant apps?

Your application provides a credentials callback that returns provider secrets per request. The component uses those credentials in memory and never persists them to the database. This pattern allows a single Convex deployment to serve multiple tenants, each using their own Resend or SES account.

What is test mode in convex-email and is it on by default?

Test mode is enabled by default in convex-email, which means outbound email is only delivered to addresses you explicitly allowlist. No real email is sent until you either add an address to the allowlist or turn test mode off. This prevents accidental sends during development and staging.

How do I install and mount the convex-email component?

Install the package with npm install @sayedhfatimi/convex-email, then mount it in your convex/convex.config.ts file by importing the email config and calling app.use(email). The component requires convex version 1.51.1 or later. After mounting, create a convex/email.ts file with your Email client instance and credentials callback.

Links

Components

Open-source building blocks for your Convex app

Browse components in this category.

Loading components