Weekday Mailjet deliverability alert that stays quiet on good days
Every weekday at 7am we check your bounce and spam complaint rates, and only message you in Slack when something is actually going wrong.
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.
What does this prompt do?
- Checks yesterday's Mailjet sending every weekday morning: hard bounces, soft bounces, and spam complaints.
- Only posts to Slack when a rate crosses your limit or roughly doubles against the past week, so a quiet channel means a healthy sender score.
- Looks up every hard bounced address in HubSpot and flags the contact so sales stops emailing dead addresses.
- Names the flagged contacts in the alert and gives a best read on the likely cause, such as one bad imported list or a single campaign.
What do I need to use this?
- A Mailjet account that sends your email
- A Slack workspace and a channel where alerts should land
- A HubSpot login, so bounced addresses can be flagged on the right contact
- Enough regular sending volume that daily rates are meaningful
How can I customize it?
- Change the alert thresholds. The defaults are 2 percent hard bounces and 0.1 percent spam complaints.
- Move the schedule off 7am, or run it seven days a week instead of weekdays only.
- Choose which Slack channel gets the alert, or have it sent to you as a direct message.
- Change which HubSpot field gets set when an address hard bounces.
FAQs
Will this message me every day?
What counts as a bad bounce rate?
What is the difference between a hard and a soft bounce?
Does it change anything in HubSpot?
Will it work if we send from several domains or campaigns?
Related templates
When your flight moves, your calendar times get corrected automatically and you get a Slack note naming the meetings you're about to miss.
Every 15 minutes, forwarded phishing reports get traced back to the server that really sent them, with a verdict in Slack and the worst senders reported.
Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.
Every weekday at 7am, sign in to the tender portals you track, filter new notices against your bid criteria, and open a deal for the ones worth chasing.
Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.
When a HubSpot deal hits Closed Won, the customer's plan, seats and renewal dates land in your DynamoDB accounts table, with a Slack note showing what changed.
Protect your sender reputation before it gets expensive
Set this up once and it stays quiet until the day your bounce rate actually needs you.