Email a digest of PagerDuty incidents with Resend
A PagerDuty + Resend agent flow
PagerDuty pages the on-call engineer, and that's the right channel for the person who has to act. The people who need the shape of things, an engineering lead, a customer-facing manager, a stakeholder who shouldn't get paged but should know production had a rough night, get nothing. This recipe gives them a readable summary on a schedule they can live with: your agent reads recent PagerDuty incidents and sends a digest email through Resend to a distribution list. It calls list_incidents over a window you set, groups them by service and urgency, and calls send-email with an HTML body that lists what fired, when, and whether it's resolved. PagerDuty answers on request, so the agent runs the digest on a cadence, a morning roundup or an end-of-shift summary, rather than emailing per page.
The flow
list_incidentsLists incidents.
send-emailSends a single transactional email immediately or scheduled, with HTML/text, attachments, CC/BCC, and tags.
Step by step
- Decide the window and the recipients
Tell the agent the time window for the digest, like the last 24 hours, and the email list it goes to. A daily summary reads differently from a per-incident alert, so frame it as a roundup.
- Read the incidents
The agent calls list_incidents filtered to your window and, if you want, to specific services or urgencies. It gets back each incident's title, service, urgency, status, and timestamps.
- Compose the digest
It groups the incidents, counts how many resolved versus still open, and builds an HTML body: a headline count, then a list per service with the title, urgency, and a link to the incident in PagerDuty.
- Send through Resend
It calls send-email from your verified sending domain to the distribution list with that digest. If there were no incidents in the window, have it either send a quiet 'all clear' line or skip the email entirely.
Tell your agent
Every morning at 8am, list PagerDuty incidents from the last 24 hours. Group them by service, count resolved versus open, and send an email through Resend from alerts@acme.com to oncall-digest@acme.com with a subject like 'Overnight incidents: 3' and an HTML body listing each incident's title, service, urgency, status, and link. If there were no incidents, send a one-line all-clear.
Setup
This flow needs both servers connected to your agent. Follow each install guide:
Worth knowing
- send-email requires a verified sending domain with SPF and DKIM set up in Resend, or the mail is rejected or lands in spam. Verify the domain once before relying on the digest.
- list_incidents paginates and defaults to a status filter, so be explicit about the statuses you want in the digest, triggered, acknowledged, and resolved, or you'll under-count by missing the ones that already resolved.
- This is a digest, not a pager. PagerDuty already handles real-time paging; sending an email per incident would just be a worse pager. Run it on a schedule so recipients get one readable summary, not a flood.
Questions
- Should this replace PagerDuty notifications?
- No. PagerDuty stays the system of record for paging the responder. This adds a separate, lower-urgency channel for people who need awareness, not action, so they get a summary instead of a page.
- Can it send the moment a high-urgency incident opens?
- It can, if you run it on a tight loop and have it email only on newly-triggered high-urgency incidents. But the natural fit is a scheduled digest; PagerDuty's own notifications are better for instant, per-incident urgency.