Provider-agnostic transactional email with a template engine, per-tenant configuration, SPF/DKIM delivery reporting, and webhook relay. Supports Elastic Email, Mailhog (dev), SMTP, Postmark, and Amazon SES. In development, Mailhog is used automatically — no provider credentials needed to test email flows.
nself plugin install nself-email
nself build
nself start# Elastic Email (recommended for production)
NSELF_EMAIL_PROVIDER=elastic-email
NSELF_EMAIL_API_KEY=your-elastic-email-api-key
NSELF_EMAIL_FROM_ADDRESS=hello@yoursite.com
# Amazon SES
NSELF_EMAIL_PROVIDER=ses
NSELF_EMAIL_API_KEY=your-aws-access-key-id:secret
NSELF_EMAIL_FROM_ADDRESS=hello@yoursite.com
# Dev: Mailhog starts automatically, no config needed
# NSELF_EMAIL_PROVIDER=mailhog (default in dev)# Send a transactional email
curl -X POST https://api.yoursite.com/email/send \
-H "Authorization: Bearer $TOKEN" \
-d '{
"to": "user@example.com",
"subject": "Welcome",
"template_slug": "welcome",
"variables": {"name": "Alice"}
}'
# Or via Hasura GraphQL mutation
# mutation {
# sendEmail(to: "user@example.com", subject: "...", template_slug: "welcome") {
# message_id
# }
# }| Variable | Required | Default | Description |
|---|---|---|---|
NSELF_EMAIL_PROVIDER | Yes (prod) | mailhog | Provider: elastic-email, mailhog, smtp, postmark, ses |
NSELF_EMAIL_FROM_ADDRESS | Yes (prod) | — | Default sender email address |
NSELF_EMAIL_API_KEY | No | — | Provider API key (reference a vault secret in production) |
NSELF_EMAIL_FROM_NAME | No | nSelf | Default sender display name |
NSELF_EMAIL_DAILY_LIMIT | No | 10000 | Global daily send limit across all tenants |
NSELF_EMAIL_RATE_LIMIT_PER_MIN | No | 60 | Per-account rate limit in sends per minute |
NSELF_EMAIL_WEBHOOK_SECRET | No | — | Signing secret for verifying inbound provider delivery webhooks |
NSELF_EMAIL_DEV_MAILHOG | No | true | Enable Mailhog in dev environments (catches all outbound email) |
| Endpoint | Method | Description |
|---|---|---|
/email/send | POST | Send a transactional email (raw or template) |
/email/template | POST | Create or update an email template |
/email/template/:slug | GET | Retrieve a template by slug |
/email/status/:id | GET | Get delivery status for a specific send |
/email/logs | GET | Query the send log with filtering and pagination |
/email/webhook/elastic-email | POST | Delivery webhook receiver for Elastic Email callbacks |
/email/health | GET | Liveness check including provider connectivity |
np_email.provider_config — per-tenant provider configurationnp_email.send_log — full delivery log with status, bounces, and opensnp_email.template — stored templates with version historyEmails not arriving in dev. Open Mailhog at http://localhost:8025 — all dev email is caught there when NSELF_EMAIL_DEV_MAILHOG=true. Nothing leaves your machine.
CRITICAL: NSELF_EMAIL_PROVIDER not set. The nself doctor check EMAIL-PROVIDER-01 blocks deployment when this is unset in production. Set it in your .env.secrets file.
Pro Plugin — ɳSelf+ | Port: 3822 | v1.1.2