Recipe: Send email from Cron or GitHub Actions

Fire transactional Notify sends from scheduled jobs and CI workflows.

Use cron when a job should email on a schedule (digests, reminders). Use GitHub Actions for deploy or ops notifications — still transactional, not newsletters.

curl from cron

curl -sS -X POST https://notify.cx/api/email/send \
  -H "Content-Type: application/json" \
  -H "x-api-key: $NOTIFY_API_KEY" \
  -d '{
    "to": "ops@example.com",
    "subject": "Nightly job finished",
    "message": "<p>The nightly job completed successfully.</p>",
    "from": "noreply@your-verified-domain.com"
  }'

GitHub Actions

- name: Notify on failure
  if: failure()
  run: |
    curl -sS -X POST https://notify.cx/api/email/send \
      -H "Content-Type: application/json" \
      -H "x-api-key: ${{ secrets.NOTIFY_API_KEY }}" \
      -d "{\"to\":\"ops@example.com\",\"subject\":\"CI failed\",\"message\":\"<p>Workflow failed on ${{ github.repository }}.</p>\"}"

Where to next?