email-lint

v0.2.3
io.github.mscode-pl/email-lint Checked 5 hours ago Published 2 days ago

Check email HTML against caniemail.com: the CSS and HTML Outlook, Gmail and Apple Mail break.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

lint_email Lint email HTML

Check email HTML against caniemail.com support data and list the CSS and HTML features that Outlook, Gmail, Apple Mail and other clients do not support, with line numbers, affected clients and caniemail notes. Pass rendered HTML (React Email, MJML and Maizzle must be built first; laravel-react-email Blade output and plain HTML can be linted directly). With neither html nor path, lints the files from email-lint.config.json. Follow up with explain_feature for a fix.

ParameterTypeDescription
clientsarrayEmail clients to check: a family (gmail, outlook, apple-mail, yahoo, samsung-email, thunderbird, protonmail, wp-pl, ...), a family and platform (outlook.windows) or "all". Defaults to email-lint.confi…
htmlstringEmail HTML to check. Use this or path.
ignorearrayFeature slugs to skip, e.g. ["css-border-radius"].
pathstringFile, folder or glob relative to the working directory, e.g. "emails/out" or "resources/views/react-email/**/*.blade.php". Folders are searched for .html and .htm files. Use this or html.
strictbooleanAlso report baseline features every email needs (doctype, <style>, class selectors) and Gmail in a mobile browser. Leave off unless a full audit is asked for.

explain_feature Explain an email feature

Explain one feature reported by lint_email: which clients lack support, the caniemail notes, whether it breaks the email (must fix) or only drops decoration (acceptable degradation), and how to fix it.

ParameterTypeDescription
slug *stringFeature slug from lint_email, e.g. "css-display-flex".
clientsarrayEmail clients to check: a family (gmail, outlook, apple-mail, yahoo, samsung-email, thunderbird, protonmail, wp-pl, ...), a family and platform (outlook.windows) or "all". Defaults to email-lint.confi…