Send transactional emails from Convex with built-in queueing, retries, webhook verification, and delivery tracking through AutoSend's API.
npm install @autosend/convexAutoSend provides a comprehensive email delivery system for Convex applications with queue-first sending, automatic retries, and delivery lifecycle tracking. It handles transactional emails through a robust component that includes webhook verification, idempotency controls, and template support. The component manages everything from initial email queuing to delivery status tracking through AutoSend's API.
The AutoSend component provides sendEmail() and sendBulk() functions that work directly in Convex mutations. Emails are automatically queued and processed with built-in retry logic for failed deliveries.
AutoSend tracks email status through the full lifecycle (queued, sending, retrying, sent, failed, canceled) and stores webhook events. Use status() for single emails or statusBatch() for multiple emails to check delivery status.
The component includes handleCallback() for processing AutoSend webhooks with HMAC signature verification and duplicate prevention. Mount the webhook route in your HTTP router to automatically receive delivery events.
Use sendBulk() with recipientData to send personalized emails to up to 100 recipients. The component interpolates placeholders in subject and content per recipient and supports AutoSend template IDs with dynamic data.
Yes, the AutoSend component automatically retries failed emails with configurable backoff for retryable failures like network issues or 5xx responses. You can track retry attempts through the status API and webhook events.
The AutoSend component supports both inline base64 content attachments and URL-referenced file attachments. You can specify filename, content type, and either base64 content or a file URL for each attachment.
AutoSend component provides deterministic idempotency where duplicate sendEmail requests resolve to the same emailId. This prevents accidental duplicate sends even if your mutation runs multiple times.
The AutoSend component stores all webhook events including delivery confirmations, bounces, opens, and clicks. Use listEvents() to query webhook events per email with configurable limits up to 200 events.
Yes, AutoSend component supports sandbox mode with testMode and sandboxTo configuration. This rewrites all recipient addresses to your test emails while preserving the original email structure for testing.