Sending AMP Emails
AMP for Email lets a message be interactive inside the inbox: accordions, carousels, forms that submit without leaving the email, and content that refreshes when it is opened. Gmail and Yahoo Mail show this version to their readers. Every other inbox, and every reader whose client does not support AMP, sees your normal HTML body instead.
So an AMP email is always two versions of the same message: the AMP version and the HTML version it falls back to. Keep them saying the same thing.
Get an AMP address
Gmail, Yahoo Mail and Mail.ru show the AMP version only when the From address is registered with them, and registration is per address, not per domain. Your readers never have to turn anything on.
On Outbound this is an AMP address: a From address that an Outbound admin has set up for AMP and assigned to your account. The AMP version only goes out from your AMP addresses. A send with ampBody, or with a template that has an AMP version, from any other fromEmail fails with a 422 whose details.availableAmpAddresses lists the addresses you can use.
- Request it. In the dashboard, open My Quota, choose Request Quota Increase and tick AMP addresses. Each address must be on a domain your account already sends from.
- Keep a template ready. To register the address, an Outbound admin sends one of your templates that has an AMP version to each provider's review inbox. Reviewers reject test content, so make it a real email: production copy, no placeholders, nothing marked as a test.
- Watch the status.
email.listAmpAddresses(), or Domains in the dashboard, shows where the address stands with each provider:not_submitted,submitted,approvedorrejected.
const { ampAddresses } = await outbound.email.listAmpAddresses();
// [{ email: 'admissions@yourdomain.com',
// registration: { gmail: { status: 'approved', reviewSentAt: '...' }, yahoo: { ... }, mailru: { ... } } }]You can send from an AMP address as soon as it is yours. Until a provider approves it, readers there see the HTML version.
Send one
Add ampBody next to htmlBody, with one of your AMP addresses as fromEmail:
await outbound.email.send({
toEmail: 'lead@example.com',
fromEmail: 'admissions@yourdomain.com',
emailSubject: 'Pick your interview slot',
htmlBody: '<p>Pick a slot: <a href="https://apply.yourdomain.com/slots">see the open slots</a></p>',
ampBody: `<!doctype html>
<html ⚡4email data-css-strict>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<style amp4email-boilerplate>body{visibility:hidden}</style>
</head>
<body>
<p>Pick a slot below.</p>
...
</body>
</html>`,
});ampBody works the same way on email.bulk (a shared ampBody for mail merge, or one per recipient), on contact-list sends, on templates (templates.create and templates.update) and on recurring emails.
What has to be true for Gmail to show it
- Send from one of your AMP addresses, approved by Gmail. Until Gmail approves the address, it shows the HTML version. Yahoo Mail and Mail.ru approve the address separately.
- The AMP version must be valid. An invalid AMP version is silently replaced by the HTML version. Check it in the dashboard with Check AMP, or paste it into the AMP playground.
- It must stay under 200,000 bytes, including the unsubscribe footer Outbound adds.
- Your sending domain must pass SPF, DKIM and DMARC. A domain set up on Outbound already does.
To see the AMP version yourself before Google approves your address, add the address in Gmail under Settings > General > Dynamic email > Developer settings.
What Outbound adds to the AMP version
- An unsubscribe footer, just before
</body>, the same as on the HTML version. - Open and click tracking. Outbound adds a 1x1 image right after
<body>and sends links through a tracking redirect, so opens and clicks in the AMP version show up in your email logs, webhooks and engagement data exactly like opens and clicks in the HTML version. To leave a link untracked, add thedata-outbound-no-trackattribute to it. - Form endpoints (
action-xhr),amp-listsources and links inside templates are never changed.
Merge variables
is filled in the AMP version from the same variables as the HTML version. The one exception is AMP's own templates: anything inside <template type="amp-mustache"> or <script type="text/plain" template="amp-mustache"> is left for AMP to fill in when the email is opened, so those placeholders never count as missing variables.
Good to know
- Outlook does not support AMP and always shows the HTML version.
- If an AMP address is taken off your account, emails already queued and recurring emails from it still go out, without the AMP version. New sends with an AMP version from it fail with a 422.
- Forwarding an email drops its AMP version, and Gmail shows the HTML version once a message is more than 30 days old.
- Endpoints your AMP version calls (
amp-list,amp-form) must answer with the CORS headers Gmail requires, includingAMP-Email-Allow-Sender, and must not redirect. email.getMessageContentreturnsampBody: the AMP version as stored, with its footer and before per-recipient tracking was added. It isnullwhen the email had no AMP version.