AMP Email
Kasplo supports AMP for Email across both the HTTP Email API and SMTP.
AMP for Email allows supported email clients (such as Gmail, Yahoo Mail, and Mail.ru) to display rich, interactive, and dynamic content directly inside the inbox—including live surveys, accordions, carousels, forms, and real-time order tracking.
Recipients using clients that do not support AMP automatically receive the standard HTML or plain-text fallback version.
1. Send via HTTP API
When sending AMP email through the Kasplo Email API, supply the AMP markup alongside your HTML and plain-text fallbacks inside the email object.
Kasplo supports both email.amp (standard) and email.amp_html (variation). If both are provided, nonempty email.amp takes precedence.
JSON Payload Example
{
"email": {
"from": "sender@yourdomain.com",
"subject": "Interactive Order Feedback",
"text": "Please rate your experience. View this message in an AMP-compatible client.",
"html": "<p>Please rate your experience on our website: <a href='https://example.com/rate'>Rate Us</a></p>",
"amp": "<!doctype html><html ⚡4email><head><meta charset=\"utf-8\"><script async src=\"https://cdn.ampproject.org/v0.js\"></script><style amp4email-boilerplate>body{visibility:hidden}</style><style amp-custom>.rating{display:flex;gap:8px;}</style></head><body><h2>How was your order?</h2><form method=\"post\" action-xhr=\"https://api.example.com/rate\"><button type=\"submit\" name=\"score\" value=\"5\">⭐⭐⭐⭐⭐</button></form></body></html>",
"recipients": {
"to": [
{
"name": "Jane Doe",
"email": "jane@example.com"
}
]
}
}
}Sending via cURL (Using jq for Template Loading)
Because AMP markup contains complex quotes and newlines, load your template file using jq to build the request payload safely:
2. Send via SMTP
When sending AMP messages via standard SMTP, construct your email as a multipart/alternative MIME message containing three parts in exact order:
text/plain(Plain text fallback)text/x-amp-html(AMP content)text/html(Standard HTML fallback)
Important MIME Rule: The
text/x-amp-htmlpart must precede thetext/htmlpart within themultipart/alternativecontainer.
Raw SMTP MIME Structure
3. AMP Document Requirements
A valid AMP email document must adhere to the official AMP for Email specification:
Doctype & Root: Must start with
<!doctype html>followed by<html ⚡4email>or<html amp4email>.Boilerplate: Must contain
<style amp4email-boilerplate>body{visibility:hidden}</style>in the<head>.AMP Runtime: Must load
<script async src="https://cdn.ampproject.org/v0.js"></script>.No External Scripts: Arbitrary
<script>tags and external JavaScript are prohibited. Only official AMP components (e.g.amp-form,amp-carousel,amp-list) may be imported in<head>.HTTPS Only: All endpoints called by
amp-listoramp-formmust use HTTPS and implement valid AMP CORS headers.Always Provide HTML Fallback: Always supply a complete HTML version so recipients whose clients disable dynamic email can still read the message.
4. Mailbox Provider Whitelisting & Registration
Even if your message markup is perfectly valid, mailbox providers require senders to register and obtain approval before dynamic AMP emails render in recipient inboxes.
Pre-Registration Checklist
Before applying for sender approval:
Configure SPF, DKIM, and DMARC on your sending domain.
Ensure DMARC alignment passes (
p=quarantineorp=rejectrecommended).Maintain a consistent sending volume and a low spam complaint rate (< 0.1%).
Have a functional, production-ready AMP email with working dynamic endpoints and a clean HTML fallback.
Provider Registration Guidelines
Gmail
Send a production AMP email to ampforemail.whitelisting@gmail.com, then fill out the Google AMP Registration Form.
In Gmail Settings → General → Dynamic email → Developer settings, whitelist your test sender email address.
Yahoo Mail
Send a test AMP email to ampverification@yahoo.com and submit Yahoo's AMP Sender Form.
Test by sending to whitelisted test addresses once accepted.
Mail.ru
Send a test AMP email to postmaster_amp@corp.mail.ru and follow instructions in Mail.ru AMP Docs.
Use Mail.ru postmaster tools for sandbox validation.
5. Fallback & Troubleshooting
The fallback HTML/text version will automatically display if:
The recipient's email client or mobile app does not support AMP.
The recipient has turned off dynamic email in their client settings.
Sender registration has not been completed or approved by the recipient's mailbox provider.
The AMP HTML fails validation (e.g., syntax errors, unsupported CSS, or disallowed attributes).
SPF, DKIM, or DMARC authentication fails for the sending domain.
Last updated