mailgun

Mailgun

Connect Mailgun to WasteNot to sync delivery, open, click, bounce, unsubscribe, and spam complaint events from your transactional and marketing email. These events power engagement-based audiences so you can target customers who are actually interacting with your email.

Prerequisites

  • A Mailgun account with a verified sending domain
  • An API key with read access to your domain's logs
  • Whether your account is on Mailgun's US or EU region

Connecting Mailgun

Step 1: Create an API key

  1. Sign in to your Mailgun account
  2. Go to Settings → API Security
  3. Create a new API key (or copy an existing one) and keep it somewhere safe

Step 2: Connect Mailgun in WasteNot

  1. Add a new Mailgun data source in WasteNot
  2. Enter a Name
  3. Enter your Domain — the Mailgun sending domain whose events you want to sync (for example, mg.example.com)
  4. Choose your RegionUS or EU, matching the region your Mailgun account is in
  5. Paste your API Key
  6. Click Connect

WasteNot will verify the credentials and begin syncing events.

What gets synced

WasteNot syncs the following Mailgun events for the sending domain you connect:

  • Delivered — the message was accepted by the recipient's mail server
  • Opened — the recipient opened the message
  • Clicked — the recipient clicked a link in the message
  • Bounced — the message permanently failed to deliver
  • Dropped — Mailgun rejected the message before sending
  • Unsubscribed — the recipient unsubscribed
  • Complained — the recipient marked the message as spam

Each event is keyed by the recipient's email address, so you can build audiences that target (or suppress) customers based on their recent email engagement.

Frequently asked questions

Can I connect multiple Mailgun domains?

Yes. Add a separate data source for each sending domain you want to sync.

Why am I only seeing the last 30 days of events?

Mailgun's Logs API only retains events for 30 days. Any history older than that is not available from Mailgun and cannot be backfilled.

My data source shows "Failed" status

Common causes:

  • The API key is invalid or has been rotated
  • The API key doesn't have access to the domain you entered
  • The region is set incorrectly (US vs. EU)
  • The sending domain hasn't been verified in Mailgun

Check your Mailgun settings, or reach out to support@wastenot.io for help.

Was this page helpful?