Skip to main content

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) with mjml2amp.

  • 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), runs mjml2amp(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) from mjml2amp to get all image URLs, then load each image (e.g. new Image(), img.onload) and read naturalWidth / naturalHeight. Pass the resulting map to mjml2amp. The theme’s useAmpImageDimensions and preview flow do this in the editor.

  • On the server: There is no DOM. After getting the amp-mjml string, use getImageUrlsForAmp to collect URLs, then resolve dimensions per URL (e.g. HTTP range request, an image-size library, or your CDN’s image API). Pass the map to mjml2amp(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:

  1. 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.
  2. 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 validation AMP-Email-Allow-Sender when using AMP-Email-Sender.
  3. Accept JSON: Request body is typically form-encoded or JSON; ensure your server accepts it and responds with Content-Type: application/json.
  4. Return the expected JSON: Success: include keys used in your success template (e.g. name, email, message). Error: include a message key (and optionally code). See AmpFormSubmitSuccessResponse, AmpFormSubmitErrorResponse, and AmpReviewsSubmitBody in easy-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:

  1. Get the AMP MJML string (e.g. EditorCore.toMJML with outputFormat: "amp-mjml").
  2. Collect image URLs with getImageUrlsForAmp(ampMjmlString) from the mjml2amp package.
  3. 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).
  4. Build an imageDimensions map: Record<string, { width: number; height: number }>.
  5. 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.