Inspect Email (Mailgun Inspect)
Submit HTML or email content to Mailgun Inspect for accessibility testing, link validation, image validation, and pre-send quality checks. Uses Basic Auth (api:API_KEY).
IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.
Input
--html/-H: HTML content to inspect (inline or path to file) - required--type/-t: Inspection type: accessibility, links, images - optional, default accessibility
Arguments: $ARGUMENTS
Instructions
Execute these steps directly - do not write code or scripts:
If $ARGUMENTS empty: ask for HTML content (paste or file path) and inspection type. Otherwise parse.
Validate: --html (non-empty or path to readable file). Get MAILGUN_API_KEY. Base: api.mailgun.net or api.eu.mailgun.net. If missing, report "Mailgun is not configured."
POST https://api.mailgun.net/v1/inspect/accessibility (or relevant /v1/inspect/* endpoint) with Basic Auth, Content-Type application/json, body: { "html": "..." }. Adjust endpoint for links/images if --type specified.
Display results: accessibility issues, link validity, image issues, etc. "✅ Inspection complete". Handle 401, 400.
Handle all errors gracefully.
Examples
/sinch-email-mailgun-inspect --html="<html><body><h1>Hello</h1></body></html>"
/sinch-email-mailgun-inspect --type=accessibility -H "<p>Content</p>"
API Reference
- Endpoint: POST /v1/inspect/accessibility (and other inspect endpoints)
- Auth: Basic api:API_KEY