GitHub Action
GitHub Action
Fail PRs when HTML email templates have rendering issues across email clients.
The Emailens GitHub Action checks your HTML email templates against 21 email clients and fails the build if compatibility scores drop below a threshold.
What it does
- Finds email HTML files matching a glob pattern
- Sends each file to the Emailens API for analysis
- Checks per-client compatibility scores against your threshold
- Reports results as GitHub annotations and a job summary
- Fails the workflow if any file is below threshold
Quick start
# .github/workflows/email-check.yml
name: Email Preview Check
on: [pull_request]
jobs:
check-emails:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: emailens/action@v1
with:
pattern: "emails/**/*.html"
threshold: "70"The Action checks .html files. For React Email, export first (npx email export --outDir out) and point pattern at out/**/*.html, or use the CLI workflow in the React Email guide.
See Setup for detailed configuration.