---
title: "Send transactional email from your Ample app"
description: "Enable a verified app sender, design hosted MJML templates or raw HTML, preview, and send transactional email from your server with Ample."
canonical_url: "https://ample.computer/guides/send-app-email"
last_updated: "2026-07-30"
author: "Ample Computer"
---

# Send transactional email from your Ample app

Enable a verified app sender, design hosted MJML templates or raw HTML, preview, and send transactional email from your server with Ample.

## The short version

An active paid Ample subscription includes recipient attempts per UTC calendar month, shared across its apps: 1,000 on Pro, 10,000 on Scale. Send from your app’s own ample.run domain using hosted MJML templates (designed in the browser studio or via CLI/MCP) or raw HTML/text rendered in your code, and inspect delivery through the CLI or MCP. CLI commands require version 0.1.39 or later.

## Who this is for

For builders adding welcome messages, receipts, account notifications or other requested transactional mail to a server-backed Ample app. Manage your plan at https://ample.computer/billing.

## How to do it

1. **Choose your public app name first.** Sign in at ample.computer, open View my apps, and use Edit link to claim an available readable address such as bookclub.ample.run. Do this before enabling email: the sender domain is the current public app hostname, not the project name passed to deploy. A sender such as notifications@bookclub.ample.run stays on that domain if you later rename the app.

2. **Enable your app sender.** Start with a deployed public server-backed app and an active paid subscription for real delivery. Choose hello, notifications, receipts or another sender prefix. For bookclub.ample.run, notifications becomes notifications@bookclub.ample.run. Once the account is on a paid plan, Ample configures DNS and verifies the domain automatically. These are sending addresses, not inboxes; set reply-to to an existing inbox. Enabling sends no email.

   ```sh
   ample email enable --app <deployment-id> --sender hello --display-name "My App" --reply-to owner@example.com
   ample email status --app <deployment-id>
   ```

3. **Design a hosted MJML template or render HTML in your app.** Create hosted MJML templates with typed Handlebars variables using ample email template (or the ample_email_template MCP tool) and refine them visually at https://ample.computer/apps/<deployment-id>/emails. The browser studio includes starter layouts, desktop/mobile/dark-mode previews, PNG/JPEG/GIF/WebP image uploads, AI edits matched to your app’s brand, and one-click publishing without redeploying. You can also render raw HTML and plain text directly in your app code.

   ```sh
   ample email template --app <deployment-id> --action save --slug welcome --name "Welcome" --subject "Welcome, {{name}}" --mjml "<mjml><mj-body><mj-section><mj-column><mj-text>Hi {{name}}!</mj-text></mj-column></mj-section></mj-body></mjml>" --variables-schema '[{"name":"name","type":"string","required":true,"example":"Alex"}]'
   ample email template --app <deployment-id> --action publish --slug welcome
   ```

4. **Preview before sending.** Preview captures a test without sending or using the monthly allowance. Pass --template and --variables (plus --draft for unpublished draft changes), or raw --subject, --text and --html. Its private link expires after 15 minutes; anyone with the link can view it, so never share previews containing login codes. Free accounts can design and preview.

   ```sh
   ample email preview --app <deployment-id> --to owner@example.com --template welcome --variables '{"name":"Alex"}' --draft --idempotency-key welcome-preview-1
   ```

5. **Deploy to bind server-side credentials.** Enabling does not restart your app. Deploy your integration (use --force when the source is unchanged) to inject AMPLE_EMAIL_URL, AMPLE_EMAIL_TOKEN and AMPLE_EMAIL_FROM at runtime. Never put the token into browser code or NEXT_PUBLIC_/VITE_ variables. Status starts with can_send; when it is false, blocked_by and next_action say what is in the way (for example paid_plan_required) and what to do. It also shows verification and whether the current release has the latest credential.

   ```sh
   ample deploy --force
   ample email status --app <deployment-id>
   ```

6. **Send from your server.** POST JSON to AMPLE_EMAIL_URL with Authorization: Bearer AMPLE_EMAIL_TOKEN. Supply to (an address array), idempotency_key, and either { template, variables } (validated against your published template schema, with HTML and plain text compiled automatically) or raw { subject, text, html }. from defaults to the configured address. Set test:true to capture rather than deliver. Send email only when requested by the recipient or app workflow.

   ```js
   const response = await fetch(process.env.AMPLE_EMAIL_URL, {
     method: 'POST',
     headers: { Authorization: `Bearer ${process.env.AMPLE_EMAIL_TOKEN}`, 'Content-Type': 'application/json' },
     body: JSON.stringify({ to: ['recipient@example.com'], template: 'welcome', variables: { name: 'Alex' }, idempotency_key: 'welcome-user-123' })
   });
   const outcome = await response.json();
   if (!response.ok) throw new Error(outcome.error?.message ?? 'Email request failed');
   if (outcome.status === 'failed') throw new Error(`Email ${outcome.id} was rejected; inspect its record.`);
   if (outcome.status === 'unknown') {
     // Save this ID for inspection. Do not retry with a new idempotency key.
     console.warn('Email outcome uncertain', outcome.id);
   }
   // Persist outcome.id and outcome.status; accepted does not prove inbox delivery.
   ```

7. **Inspect outcomes and retry safely.** Use one stable idempotency key per logical message. Repeating the same payload/key returns the original result; changing the payload conflicts. An accepted result is not proof of inbox placement. For unknown outcomes, inspect the message instead of retrying with a new key. Hard bounces, complaints and unsubscribes suppress the recipient within your account.

   ```sh
   ample email list --app <deployment-id>
   ample email get <message-id>
   ```

8. **Control access and allowance.** Every recipient counts separately toward the account-wide monthly limit (1,000 on Pro, 10,000 on Scale). Overage is blocked, not charged automatically. Clearly rejected requests are refunded; uncertain or partially accepted submissions remain charged. Disable immediately revokes the app credential. Rotation also revokes the old token; redeploy afterward to inject the replacement. Remote MCP exposes the same workflow as ample_email_enable, ample_email_status, ample_email_template, ample_email_preview, ample_email_send, ample_email_list and ample_email_get.

   ```sh
   ample email disable --app <deployment-id>
   # Or rotate, then redeploy:
   ample email rotate-token --app <deployment-id>
   ample deploy --force
   ```

## What this supports

- Paid subscriptions for real sending; free design and test capture
- Verified app-specific ample.run domains
- Hosted MJML templates with browser studio or raw HTML/text; CLI 0.1.39+ and remote MCP

## Know the limits

- 1,000 recipient attempts per account per UTC month on Pro, 10,000 on Scale; no automatic paid overages
- Static-only sites need a server backend to protect credentials
- No receiving mailboxes, SMTP credentials, custom sender domains, attachments or bulk campaigns
- Inbox placement depends on the receiving mail service; verified authentication and delivered status do not guarantee the inbox

## Common failure modes

- **Paid plan required** Activate a paid subscription at https://ample.computer/billing. Designing and previewing remain available.
- **Domain verification pending** Inspect ample email status. blocked_by domain_pending means wait for DNS verification; paid_plan_required means verification starts once the account upgrades.
- **Template not published or variables invalid** Publish the template in the browser studio or via ample email template --action publish before sending, and pass all required variables matching the declared schema.
- **Unknown delivery outcome** Read the existing message. Do not retry with a new idempotency key.
- **Credential revoked or not bound** Deploy --force after enable, rotation or sender changes, then inspect status.
- **Email still uses the old app domain** The sender domain is fixed when email is first enabled. Renaming the app afterward, disabling/re-enabling email, or rotating the token does not migrate it. Choose the public name first; contact support for an existing-domain migration.

## Related guides

- [How to deploy an app with one command](https://ample.computer/guides/deploy-app-one-command)

## Machine-readable resources

- [llms.txt](https://ample.computer/llms.txt) | [AGENTS.md](https://ample.computer/AGENTS.md) | [sitemap.md](https://ample.computer/sitemap.md) | [OpenAPI](https://ample.computer/openapi.json)
