AMP Email FAQ
Common questions and issues when integrating AMP for Email with Easy Email Pro.
Which email clients support AMP Email?​
AMP for Email is supported by a subset of clients. Major supporters include:
- Gmail (web and mobile when the recipient has AMP enabled)
- Mail.ru
Support and behavior can change. For the official list and requirements, see AMP for Email – Supported Email Platforms.
What is the difference between "Export AMP MJML" and "Export AMP Email"?​
Export AMP MJML: Exports the template as AMP MJML (intermediate format). This is the XML/MJML string with
outputFormat: "amp-mjml". It includes AMP blocks but is not yet final HTML. Use this when you need to store the amp-mjml source or process it later (e.g. on a server) withmjml2amp.Export AMP Email: Produces final AMP HTML ready to send. The editor first gets the amp-mjml string, then collects image URLs with
getImageUrlsForAmp, resolves image dimensions (e.g. in the browser), runsmjml2amp(mjmlStr, { imageDimensions }), and optionally applies mergetags. The result is the HTML you can use in the AMP MIME part.
Why do AMP emails require explicit image dimensions? How do I get them?​
AMP requires every image to have explicit width and height (for layout stability). The mjml2amp package therefore needs an imageDimensions map: image URL → { width, height }.
In the browser (e.g. editor export): Use
getImageUrlsForAmp(ampMjmlString)frommjml2ampto get all image URLs, then load each image (e.g.new Image(),img.onload) and readnaturalWidth/naturalHeight. Pass the resulting map tomjml2amp. The theme’suseAmpImageDimensionsand preview flow do this in the editor.On the server: There is no DOM. After getting the amp-mjml string, use
getImageUrlsForAmpto collect URLs, then resolve dimensions per URL (e.g. HTTP range request, animage-sizelibrary, or your CDN’s image API). Pass the map tomjml2amp(ampMjmlString, { imageDimensions, imageDimensionsStrict: false }).
See AMP Block – Server-side rendering and image dimensions for details.
Form or Reviews submission fails (CORS, 415, no response). What should I check?​
AMP Form and Reviews blocks submit via action-xhr (POST). The endpoint must:
- Use the correct URL: The form’s action-xhr (or mergetag like
AMP_FORM_ACTION_URL/AMP_REVIEWS_ACTION_URL) must point to your endpoint. - Set AMP for Email CORS headers: Respond with AMP for Email CORS headers. For example:
Access-Control-Allow-Origin,AMP-Access-Control-Allow-Source-Origin, and for sender validationAMP-Email-Allow-Senderwhen usingAMP-Email-Sender. - Accept JSON: Request body is typically form-encoded or JSON; ensure your server accepts it and responds with
Content-Type: application/json. - Return the expected JSON: Success: include keys used in your success template (e.g.
name,email,message). Error: include amessagekey (and optionallycode). SeeAmpFormSubmitSuccessResponse,AmpFormSubmitErrorResponse, andAmpReviewsSubmitBodyineasy-email-pro-kit.
Also handle OPTIONS for CORS preflight if needed. For a full example, see AMP Block – Form / Reviews backend and the Next.js demo pages/api/form.ts.
How do AMP blocks appear in non-AMP clients (fallback)?​
Each block has an output target: "All", "HTML only", or "AMP only".
- AMP only blocks are omitted when you export with
outputFormat: "mjml"(normal HTML) unless fallback is enabled. - When fallback is enabled, a simple static/MJML version of the block is included for non-AMP clients so they still see content (e.g. first product image, static form).
So: for AMP-only blocks, either they are skipped in plain HTML export or, with fallback, a non-interactive version is shown. See AMP Block – Concepts (output format and output target).
How do I get image dimensions when rendering AMP on the server (no browser)?​
On the server you don’t have a DOM to load images. Use this approach:
- Get the AMP MJML string (e.g.
EditorCore.toMJMLwithoutputFormat: "amp-mjml"). - Collect image URLs with
getImageUrlsForAmp(ampMjmlString)from themjml2amppackage. - For each URL, get width and height (e.g. HTTP range request to fetch image headers, a library like
image-size, or your CDN’s image API). - Build an
imageDimensionsmap:Record<string, { width: number; height: number }>. - Call
mjml2amp(ampMjmlString, { imageDimensions, imageDimensionsStrict: false })to get the final HTML.
Details are in AMP Block – Server-side rendering and image dimensions and Server-side rendering.
More information​
- AMP Block – Plugin registration, export, image dimensions, Form/Reviews backend.
- Server-side rendering – General server-side flow and AMP.