Weekday Mailjet deliverability alert that stays quiet on good days

By General Input

Every weekday at 7am we check your bounce and spam complaint rates, and only message you in Slack when something is actually going wrong.

Integrations

  • Mailjet
  • Slack
  • HubSpot

Type

Agentic Task

Categories

  • Marketing
  • Operations

Every weekday at 7am, check my Mailjet sending health and warn me before deliverability problems get expensive. Run this on a cron schedule, Monday through Friday at 7am in my local timezone.

Start by pulling the last 24 hours of Mailjet activity. Use "Get aggregated statistics counters" for the totals I need as denominators, including messages sent, delivered, bounced and marked as spam. Use "List and retrieve bounce statistics" for the individual bounce events, and keep hard bounces separate from soft bounces because they mean very different things. Use "List and retrieve message information" to pull the sending and spam detail on messages that were blocked or complained about, so the alert can say something specific rather than just quoting a percentage.

Also pull the same counters for the trailing seven days so there is a baseline to compare against. I want the trailing seven day average rate for hard bounces, soft bounces and spam complaints, measured over the seven days before the day being checked so today's numbers are not folded into their own baseline.

Calculate three rates against messages sent in the last 24 hours: hard bounce rate, soft bounce rate and spam complaint rate. Compare each against thresholds I can edit. Default to alerting when the hard bounce rate is above 2 percent or the spam complaint rate is above 0.1 percent, and treat a soft bounce rate above 5 percent as worth mentioning. Separately from the absolute thresholds, also alert when any of the three rates has roughly doubled against its trailing seven day average, because a jump from a low base is an early warning even while the absolute number still looks safe. Suppress the doubling rule on very low volume, so a day with only a handful of sends does not trip an alert on a single bounce.

Stay silent on normal days. If no threshold is crossed and nothing has roughly doubled, post nothing to Slack and simply end the run. An alert that fires every morning gets ignored, and the whole value here is that a message from this workflow means something actually needs my attention.

When there are hard bounced addresses, look each one up in HubSpot with "Search Contacts". For every match, flag the contact with "Update Contact" so sales stops emailing dead addresses, setting the email status property to show the address hard bounced and noting the date it happened. If a bounced address has no matching HubSpot contact, skip it quietly and do not create a new contact.

When an alert is warranted, post exactly one Slack message with "Send a Message". Lead with which threshold was crossed, then show the actual rates next to their trailing seven day averages so the size of the change is obvious at a glance. Name the HubSpot contacts that were flagged, and say how many hard bounced addresses had no CRM match. Keep it to a single message rather than a thread of several.

Finish the message with your best read on the likely cause. Look at whether the bounces cluster around one imported contact list, a single sending domain, or one campaign, and say which one accounts for most of the damage. If the bounces are spread evenly with no clear pattern, say that plainly, because that points at a different problem than one bad list. Be honest about your confidence, and recommend the single action I should take first.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredTurn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe reveals