Skip to content

Daily

Get yesterday's delivery numbers each morning

One email shows accepted, delivered, bounced and complained counts for each sending domain.

Runs
Daily
Apps
Mailgun
AI
Not needed
Access
read

Send this to your assistant

Create a ClickRuntime automation: every day at 7am, email me yesterday's Mailgun accepted, delivered, bounced and complained counts for each of my domains.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

The first sign that email delivery is going wrong is rarely an error. It is a slow shift in the numbers, such as Gmail accepting fewer messages, a small domain rejecting everything or a sudden dip in volume because a job stopped running. Developers who rely on Mailgun for order confirmations and notifications often only look at the logs when a customer complains. Without a daily view, an outage can run for days.

Each morning, ClickRuntime queries Mailgun's metrics for yesterday, grouped by recipient domain, and emails you a table showing how many messages were sent, delivered and failed. You can see at a glance if a particular provider is behaving differently from the rest.

It helps engineering leads, ecommerce operators and anyone who needs proof that their transactional email is landing.

What you get out of it

  • Problems with one provider stand out

    Grouping by recipient domain shows that, say, outlook.com rejected 14 percent of messages while gmail.com rejected none. That points to a provider-specific issue you can raise with them or fix with authentication.

  • A missing job is revealed

    If yesterday's volume is half of a normal day, a scheduled task or a webhook probably stopped. The report shows the gap the next morning instead of when customers ask where their receipts are.

  • Failures are counted, not guessed

    Instead of reading raw logs, you get a failed total next to the sent total. A rising ratio over several days is a clear reason to look at your list quality or sending practices.

  • A routine check that takes a minute

    Reading one email over coffee replaces a regular login to the Mailgun dashboard. People actually keep the habit because it requires no effort to start. It fits into the morning routine without anyone having to remember a login.

  • Evidence for customers and auditors

    If a client claims they never received an email, you can show how many were delivered that day to their domain. Stored reports provide a trail for disputes and compliance questions.

  • Trends build up over weeks

    Saved reports let you compare this month with last. A slow rise in failures to one provider is easy to spot when the figures sit side by side in your inbox.

How it works

What happens, step by step

  1. Every day, ClickRuntime pulls yesterday's sending figures from Mailgun for each of your domains.

  2. It counts how many messages were accepted, delivered, bounced and marked as spam.

  3. You get one email with a line per domain.

Before it runs live

  • Connect Mailgun

What you get

RunsDaily
Get yesterday's delivery numbers each morningtoday, 9:00Succeeded
Email · Mailgun delivery yesterdaymg.example.com: accepted 1204, delivered 1187, bounced 12, complained 1

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
daily_delivery_report.pyexample
from clickruntime import on_trigger, credentials, http, notify

API = "https://api.mailgun.net/v3"

@on_trigger
def run(event):
    auth = ("api", credentials.secret("MAILGUN_API_KEY"))
    domains = http.get(f"{API}/domains", auth=auth, params={"limit": 100}).json()["items"]
    lines = []
    for d in domains:
        stats = http.get(f"{API}/{d['name']}/stats/total", auth=auth, params={
            "event": ["accepted", "delivered", "failed", "complained"],
            "duration": "1d", "resolution": "day"}).json()["stats"]
        s = stats[-1] if stats else {}
        lines.append(f"{d['name']}: accepted {s.get('accepted', {}).get('total', 0)}, "
                     f"delivered {s.get('delivered', {}).get('total', 0)}, "
                     f"bounced {s.get('failed', {}).get('permanent', {}).get('total', 0)}, "
                     f"complained {s.get('complained', {}).get('total', 0)}")
    notify.email_me("Mailgun delivery yesterday", "\n".join(lines))
    return {"domains": len(domains)}

FAQ

Common questions

What is included in the sent, delivered and failed numbers?
Sent counts messages Mailgun accepted from you, delivered counts those the recipient server accepted, and failed counts those that bounced or were dropped. These are taken from the Metrics API for the previous day in your configured time zone.
Can I break the report down by something other than domain?
Yes. Mailgun metrics can also be grouped by sending domain, tag or IP, so you could see results per mail stream such as receipts versus newsletters. Ask for the grouping you prefer and approve the change.
Does it work with more than one Mailgun sending domain?
A report covers the domain or account you connect, and results can be filtered per domain. If you operate several domains, you can set up a separate report for each or combine them into one table.
What permissions does it need?
read. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get yesterday's delivery numbers each morning” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.