Emailens
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:

  1. Go to Settings > Secrets and variables > Actions
  2. Add a new secret named EMAILENS_API_KEY
  3. 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.

ThresholdStrictness
60Lenient — allows significant issues
70Moderate — catches major problems
80Strict — high compatibility required
90Very 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"

On this page