Hourly
Get warned when your bounce rate climbs
You hear the same day if today's bounces pass your limit, once rather than every hour.
- Runs
- Hourly
- Apps
- Mailgun
- AI
- Not needed
- Access
- private API key (read)
Send this to your assistant
Create a ClickRuntime automation: every hour, check today's bounce rate for my Mailgun domain mg.example.com and email me if it's above 5%, no more than once a day.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Bounce rate is the number mailbox providers watch most closely when deciding whether your Mailgun domain deserves the inbox. A single bad import, a leaked signup form or a typo in a template can send hundreds of messages to dead addresses in an afternoon. When bounces climb above a few percent, deliverability suffers for every message you send, including password resets and invoices.
Each hour, ClickRuntime queries Mailgun's Metrics API for today's totals, works out the bounce rate as a share of attempted deliveries, and compares it with your limit. If the rate goes over, you get a single alert for that day, so you are warned without being flooded by repeats.
It is meant for SaaS teams and developers who send transactional and marketing email through Mailgun and cannot afford a damaged sender reputation.
What you get out of it
Reputation damage is stopped early
Providers like Gmail and Yahoo respond to sustained bad sending within days. An hourly check means you can pause a faulty campaign the same afternoon, before throttling or spam-folder placement sets in.
Bad data is traced to its source
When the alert fires, you know the problem started today, so you check the latest import, form or integration. Without the alert you would be hunting through weeks of logs for the cause.
Critical emails keep arriving
Password resets, receipts and login codes share your sending domain with newsletters. Protecting the domain from a bounce spike protects the messages customers actually need to receive. The hourly check keeps that risk small, which matters most for the emails customers depend on.
One alert per day, not fifty
Because the warning fires once per day per breach, your inbox and chat are not buried. It stays meaningful, so the team continues to read it when it appears. That keeps people reading it, and nobody learns to ignore the warnings that come from this check.
A dated record of incidents
Every alert and run is logged, giving you evidence of when issues occurred and how quickly you responded. That helps in post-mortems and in conversations with Mailgun support. That record also helps when you explain an incident to management or to a customer.
How it works
What happens, step by step
Every hour, ClickRuntime pulls today's delivery and bounce counts from Mailgun.
It works out today's bounce rate and compares it with your limit.
The first time it goes over, you get an email with the rate in the subject and the counts. You won't get another until the next day.
Before it runs live
- Connect Mailgun
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Mailgun steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, timezone
from email.utils import format_datetime
from clickruntime import on_trigger, credentials, http, notify, state
DOMAIN = "mg.example.com"
LIMIT = 5.0
@on_trigger
def run(event):
now = datetime.now(timezone.utc)
start = now.replace(hour=0, minute=0, second=0, microsecond=0)
resp = http.post("https://api.mailgun.net/v1/analytics/metrics",
auth=("api", credentials.secret("MAILGUN_API_KEY")), json={
"start": format_datetime(start), "end": format_datetime(now), "resolution": "day",
"metrics": ["delivered_count", "bounced_count", "bounced_rate"],
"filter": {"AND": [{"attribute": "domain", "comparator": "=", "values": [{"label": DOMAIN, "value": DOMAIN}]}]}})
resp.raise_for_status()
items = resp.json().get("items", [])
m = items[0]["metrics"] if items else {}
rate = float(m.get("bounced_rate") or 0)
today = str(start.date())
if rate > LIMIT and state.get("alerted_on") != today:
notify.email_me(f"Mailgun bounce rate {rate:.1f}% on {DOMAIN}",
f"{m.get('bounced_count', 0)} bounced, {m.get('delivered_count', 0)} delivered today.")
state.set("alerted_on", today)
return {"bounce_rate": rate}FAQ
Common questions
How is the bounce rate calculated?
What threshold should I choose?
Does it separate hard bounces from soft bounces?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Get yesterday's delivery numbers each morning
One email shows accepted, delivered, bounced and complained counts for each sending domain.
See how it worksGet a message when an email permanently fails
Each hard failure or spam complaint shows up with the recipient and reason, so you can follow up.
See how it worksKnow the moment your website goes down
Your team hears in Slack when the site stops responding or slows down, and again when it's back.
See how it worksKeep exploring
Set up “Get warned when your bounce rate climbs” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.