Production Best Practices
Relevant source files
The following files were used as context for generating this wiki page:
This guide outlines the technical requirements, configuration strategies, and operational recommendations for deploying Send Again in a production environment. It covers infrastructure setup, deliverability optimization, and security compliance based on the project's architecture.
The platform is designed to run either as a managed Cloud version or a Self-Hosted instance. For production, the self-hosted path requires a robust integration with Amazon SES, Supabase, and external worker processes to ensure reliable email delivery and event tracking.
Sources: README.md:31-40, src/app/terms-of-use/page.tsx:49-53
Deliverability and DNS Configuration
Maintaining high deliverability in production requires strict adherence to email authentication standards. Send Again automates much of this through its DNS integration module, supporting manual entry or automated setup via Namecheap, Cloudflare, and Route53.
Required Authentication Records
To avoid being flagged as spam, every production workspace must configure the following records:
- SPF (Sender Policy Framework): A TXT record authorizing Amazon SES to send on behalf of the domain.
- DKIM (DomainKeys Identified Mail): Three CNAME records providing cryptographic proof of the sender's identity.
- DMARC: A policy record (e.g.,
p=quarantine) defining how receivers should handle unauthenticated mail. - SES Verification: A unique TXT token provided by AWS to verify domain ownership.
Sources: src/app/app/page.tsx:1571-1685, README.md:10
Automated DNS Workflow
The system provides a specialized setup utility to sync these records automatically with supported providers.
The automated setup verifies the existence of a configuration set, SPF records, DKIM status, and the presence of an unsubscribe page.
Sources: src/app/app/page.tsx:1350-1450, src/app/app/page.tsx:1690-1700
Job Processing and Scaling
Production workloads involving large recipient lists must use the asynchronous job processor to prevent request timeouts and ensure delivery persistence.
Worker Configuration
It is highly recommended to use an external cron job or worker to invoke the job processing endpoint. This prevents the web server from being bogged down by long-running SMTP transactions.
| Variable | Recommended Value | Description |
|---|---|---|
SEND_JOB_PROCESSOR_TOKEN | Secure Random String | Shared secret required for the /api/send/process endpoint. |
SEND_JOB_BATCH_SIZE | 50-100 | Number of recipients processed in a single batch. |
SEND_JOB_CONCURRENCY | 4-10 | Number of parallel sends per batch execution. |
SEND_JOB_MAX_RECIPIENTS_PER_JOB | 250+ | Total recipients handled per worker invocation. |
Sources: README.md:73-81, README.md:120-125
Job Lifecycle
When a send is initiated, the system transitions through several states. Monitoring these via the API is critical for production visibility.
Sources: src/lib/openapi.ts:61-80, README.md:118-120
Security and Compliance
Scoped API Keys
Production integrations should never use the master Supabase secret key. Instead, generate scoped API keys (sk_...) restricted to the specific actions required by the integration.
contacts.read/contacts.write: For syncing CRM data.send.read/send.write: For triggering campaigns or checking status.
Sources: src/lib/openapi.ts:22-30, src/app/app/page.tsx:1152-1175
Unsubscribe and Bounce Handling
Compliance with anti-spam laws requires functional unsubscribe links. Send Again automatically appends these to footers, but production instances must ensure:
APP_BASE_URLis set to the public domain.UNSUBSCRIBE_SECRETis unique and secure to prevent link tampering.- The SES Configuration Set is correctly linked to an SNS topic pointing to the
/api/webhooks/snsendpoint for automatic bounce and complaint suppression.
Sources: README.md:113-116, src/app/terms-of-use/page.tsx:32-38
Performance Tuning
Rate Limiting
Production environments should tune the rateLimit setting per workspace. This introduces a delay (in milliseconds) between individual sends within a job to stay within AWS SES quotas and prevent IP reputation damage.
Sources: src/app/api/workspaces/settings/route.ts:98-105, src/app/app/page.tsx:1915-1925
Workspace Management
For organizations managing multiple clients or brands, use separate Workspaces. Each workspace maintains its own:
- Isolated contact lists and suppression records.
- Unique sending identity (From name/email).
- Dedicated API keys and billing credits.
Sources: src/app/page.tsx:64-68, src/app/app/page.tsx:945-960
Summary
Achieving a production-ready state with Send Again involves configuring robust DNS authentication (SPF/DKIM/DMARC), offloading email processing to an external worker via the /api/send/process endpoint, and enforcing security through scoped API keys. Regular monitoring of the SNS webhook-driven event history is essential for maintaining domain reputation and handling recipient churn.
Sources: README.md:118-120, src/app/app/page.tsx:1690-1700