Daily email deliverability digest in Slack

By General Input

Catch sender reputation problems before they snowball. Every weekday at 9am, post a green, yellow, or red status check on yesterday's email performance.

Integrations

  • Postmark
  • Slack

Type

Deterministic Code

Categories

  • Operations
  • Marketing

Build me a code workflow that posts a daily email deliverability digest from Postmark into a Slack channel, Monday through Friday at 9am local time.

Trigger: cron, weekdays at 09:00 in the user's timezone.

Inputs the user should configure at the top of the workflow: the Postmark server to monitor (default to their production server), the Slack channel to post to (default #email-ops), the timezone, and the green/yellow/red thresholds. Defaults: red when hard-bounce rate is above 2 percent OR there are any spam complaints in the window; yellow when the soft-bounce rate is more than 50 percent above its 7-day average; green otherwise.

Steps:

1. Sanity check the Postmark server. Call Postmark's Get Server endpoint and confirm DeliveryType is "Live" (not "Sandbox"). If it is a sandbox server, post a single-line warning to Slack and exit, so we never silently report on test traffic.

2. Pull yesterday's stats from Postmark, for the 24-hour window ending at midnight local time. Use these three operations in parallel, each scoped to the configured server and to the [fromdate, todate] range that covers yesterday:

- Postmark Get Outbound Overview (sends, bounce rate, opens, unique opens, spam complaints, total clicks).

- Postmark Get Bounce Counts (daily and total counts by type: HardBounce, SoftBounce, Transient, SMTPApiError). Bounce rate is (HardBounce + SoftBounce) / Sent.

- Postmark Get Spam Complaints (per-day and total spam complaints).

All three endpoints return the whole window in one call; no pagination needed.

3. Pull the previous day's stats (the day before yesterday) using the same three operations, so we can compute day-over-day deltas.

4. Pull the prior 7 days of stats using the same three operations with a 7-day window ending the day before yesterday, and compute 7-day averages for: total sends, hard bounces, soft bounces, bounce rate, spam complaints, unique opens. This is the baseline.

5. Decide the status. Apply the threshold rules in order: red first, then yellow, then green. Capture the reason string for the status (e.g. "hard-bounce rate 2.4% > 2% threshold") so we can show it in the message.

6. Format a compact Slack message. Use Slack mrkdwn, not standard Markdown. It should have: a one-line headline with a colored circle emoji matching the status (🟢/🟡/🔴), the date the digest covers, and the reason if not green. Below that, a small fixed-width table inside a code block with columns Metric | Yesterday | Δ vs prior day | 7-day avg, with rows for Total Sends, Hard Bounces, Soft Bounces, Bounce Rate, Spam Complaints, Unique Opens. Format percentages to one decimal place. End with a single line linking to the Postmark server activity page for that server, formatted as <https://account.postmarkapp.com/servers/{serverId}/streams/outbound/activity|Open in Postmark>.

7. Post the message to the configured Slack channel using Slack Send a Message.

Edge cases to handle:

- If yesterday had zero sends, skip the threshold logic and post a single calm line: "No sends in the last 24 hours on {serverName}." Do not flag this as red.

- If any of the Postmark calls fails, post a short failure notice to Slack with the error code/message and the server name, so the team notices the digest didn't run cleanly.

- Round all rates to one decimal place. Show counts as integers with thousands separators.

This is deterministic arithmetic and formatting on structured stats data, so build it as a code workflow with discrete nodes, not an agent.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teamsCatch feature flags that never got switched on in productionKajabi customer support console for member access fixes