Mailgun Email Preview service with RESTful JSON HTTP API for providing email previews.
Email Preview API (1.0.0)
https://api.mailgun.net/
https://api.eu.mailgun.net/
Code Analysis
The Code Analysis API analyzes HTML email content to detect CSS features and provides comprehensive compatibility reports across major email clients, including support statistics, version-specific compatibility data, and detailed feature breakdowns to ensure optimal email rendering.
- US Mailgun
https://api.mailgun.net/v1/inspect/analyze/{test_id}
- EU Mailgun
https://api.eu.mailgun.net/v1/inspect/analyze/{test_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://api.mailgun.net/v1/inspect/analyze/{test_id}' \
-H 'Content-Type: application/json' \
-d '{
"html": "string",
"url": "string",
"mime": "string",
"transfer_encoding": "string",
"charset": "string"
}'{ "meta": { "status": "Processing", "version": 4 }, "items": { "id": "67a654ba0f53254b9fdca3e2", "links": { … } } }
- US Mailgun
https://api.mailgun.net/v1/inspect/analyze/{test_id}
- EU Mailgun
https://api.eu.mailgun.net/v1/inspect/analyze/{test_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
-u <username>:<password> \
'https://api.mailgun.net/v1/inspect/analyze/{test_id}'{ "message": "Test <id> has been successfully deleted." }
Filter results by support type (y=supported, a=partial, n=not supported, u=unknown)
Group variants by their implementation notes. When set to 'notes', variants within each support level are grouped by their note content. The response structure changes: instead of VariantReference arrays, each support level (y/a/n/u) contains GroupedVariantsByNote objects with 'note' field and 'variants' array. A 'grouped_by' field is added to meta.
| Value | Description |
|---|---|
| notes | Group variants by their implementation notes |
- US Mailgun
https://api.mailgun.net/v1/inspect/analyze/{test_id}/versions/{version_id}
- EU Mailgun
https://api.eu.mailgun.net/v1/inspect/analyze/{test_id}/versions/{version_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.mailgun.net/v1/inspect/analyze/{test_id}/versions/{version_id}?slug=string&support_type=string&group_by=notes'A 200 response
Test results including detected features and their support data
List of email features detected in the analyzed HTML
Maps note reference IDs to their corresponding implementation notes
Unique identifier for this instance of the feature in the HTML
Line number where the feature was found in the HTML source
Email clients that fully support this feature
Email clients that partially support this feature
{ "meta": { "application_support": { … }, "count": 1, "inbox_provider_support": { … }, "market_support": { … }, "status": "Completed", "version": 2 }, "items": { "id": "67a654ba0f53254b9fdca3e2", "version": 2, "features": [ … ] } }