GitHub Action
GitHub Action Setup
Step-by-step guide to adding the Emailens email check to your CI pipeline.
1. Create the workflow file
Create .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"2. Add an API key (optional)
For higher rate limits and to track usage, add your API key as a repository secret:
- Go to Settings > Secrets and variables > Actions
- Add a new secret named
EMAILENS_API_KEY - Update your workflow:
- uses: emailens/action@v1
with:
pattern: "emails/**/*.html"
threshold: "80"
api-key: ${{ secrets.EMAILENS_API_KEY }}3. Customize the threshold
The threshold is a score from 0-100. A file fails if any email client scores below this value.
| Threshold | Strictness |
|---|---|
60 | Lenient — allows significant issues |
70 | Moderate — catches major problems |
80 | Strict — high compatibility required |
90 | Very strict — near-perfect rendering |
4. Filter specific clients
Only check the clients you care about:
- uses: emailens/action@v1
with:
pattern: "emails/**/*.html"
threshold: "80"
clients: "gmail-web,outlook-windows,apple-mail-macos"