Skip to main content
Mailgun → Customer.ioIntegration guide

Connecting Mailgun to Customer.io

Mailgun is developer-facing email infrastructure, which means the sending logic lives in your application and the marketing team frequently does not know what is being sent or when. Customer.io triggers messages from behaviour, which means an event you send is not recorded — it is acted on, usually within seconds, by sending something to a real person. The join between them succeeds or fails on one thing: whether the person identifier you assign reaches the Mailgun message before the conversion happens, because Customer.io can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Move Mailgun sends into Customer.io or sync them properly

First decide whether Customer.io should take over the transactional sends now coded through Mailgun. If both stay, don't let one event trigger a coded Mailgun email and a Customer.io campaign. Use Mailgun hard bounces and complaints to update the matching Customer.io person, keyed on the identifier attached as a custom variable, not email, to avoid duplicate profiles.

Customer.io can send transactional messages itself, which makes this pair a decision before it is an integration. Moving the receipts, resets and alerts your application sends through Mailgun into Customer.io puts the trigger logic in a tool marketing can read, which fixes the main complaint about Mailgun: nobody outside engineering knows what goes out or why. Check what your Customer.io plan includes and how its sending setup fits your domain before moving anything.

If both stay, the dangerous overlap is a single application event triggering a Mailgun send in code and a Customer.io campaign through the Track API. A signup that gets a coded welcome email and a Customer.io welcome campaign is the classic case. Send the event to Customer.io with the person identifier you assigned, and remove the coded twin, or exclude that event from the campaign trigger.

Mailgun's hard bounces and complaints should update the matching Customer.io person so campaigns stop mailing an address your transactional stream already knows is dead. Key the update on the same identifier you send to Customer.io, attached to each Mailgun message as a custom variable. If the webhook matches on email and the person is keyed on user ID, a second profile is created and keeps receiving campaigns.

Mailgun → Customer.io · what breaks

Why this join usually fails — Mailgun → Customer.io

  1. 01

    The person identifier you assign never reaches Mailgun

    No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool.

  2. 02

    Nobody able to say why a message was sent

    When send logic lives in application code, the marketing team cannot audit it and the engineering team is not thinking about attribution. Messages accumulate, nobody owns the list, and any analysis of email's contribution is unreliable.

  3. 03

    A test event sending a real email

    Because campaigns evaluate on arrival, there is no safe place to test in production. A malformed purchase event fired during development against a live workspace will send a real order confirmation to a real person, and that cannot be recalled.

  4. 04

    Nothing reconciles afterwards

    Customer.io shows the event and the resulting campaign activity on the person's timeline. Check what the event triggered, not just that it arrived.

Mailgun → Customer.io · the fix

What working looks like — Mailgun → Customer.io

  • The person identifier you assign on every message

  • Conversions arriving in Customer.io

    The event lands on the person, evaluates against every campaign trigger and segment condition, and may send immediately.

  • Reconciled against the source

Mailgun → Customer.io · architecture

How Mailgun and Customer.io actually connect

  1. 1

    Mailgun holds the truth

    Because sends are triggered in code, the only reliable description of why a message went out lives in your application, not in Mailgun's logs.

  2. 2

    Customer.io needs a click to match

    Customer.io needs the person identifier, the event name and any attributes the campaign conditions reference. An event whose attributes are missing will still trigger a campaign, which may then send a message with an empty placeholder in it.

  3. 3

    The identifier is the bridge

    The person identifier you assign, captured at the visit and carried into the Mailgun message.

  4. 4

    The event source decides reliability

    Send orders. Use Mailgun events for deliverability monitoring only.

  5. 5

    Deduplication at the destination

    Customer.io does not deduplicate events. A purchase sent twice can enter a workflow twice and send two emails, and unlike a reporting duplicate the customer sees this one.

Mailgun → Customer.io · normal or broken

Working vs. broken, side by side — Mailgun → Customer.io

Normal, not a fault

  • The person identifier you assign present on the message

  • Sent from your order system

  • Deduplicated correctly

    Customer.io does not deduplicate events. A purchase sent twice can enter a workflow twice and send two emails, and unlike a reporting duplicate the customer sees this one.

  • Reconciles with the source

Actually broken

  • The person identifier you assign missing on most records

    No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool.

  • Sent from the browser

    When send logic lives in application code, the marketing team cannot audit it and the engineering team is not thinking about attribution. Messages accumulate, nobody owns the list, and any analysis of email's contribution is unreliable.

  • Counted twice, or not at all

    Because campaigns evaluate on arrival, there is no safe place to test in production. A malformed purchase event fired during development against a live workspace will send a real order confirmation to a real person, and that cannot be recalled.

  • Nobody has reconciled it

Mailgun → Customer.io · diagnose

Diagnostic order — Mailgun → Customer.io

  1. 01

    Count messages carrying the person identifier you assign

  2. 02

    Follow one real conversion end to end

  3. 03

    Inventory every code path that triggers a send

    Usually the first time anyone has, and it frequently finds sends nobody remembers building.

  4. 04

    Confirm which workspace you are writing to before sending anything

    Environment separation is the whole safety mechanism in behaviour-triggered tools, and it is the thing most often skipped.

  5. 05

    Read the match rate, not the success message

    Customer.io shows the event and the resulting campaign activity on the person's timeline. Check what the event triggered, not just that it arrived.

Mailgun → Customer.io · prove

How it gets proven — Mailgun → Customer.io

Source of truth

Your application's own record of what triggered the send, joined to the order.

  • The person identifier you assign confirmed present on a live message.
  • Events confirmed on person profiles with the triggered campaign activity verified, in a test workspace before production.
  • Orders reconciled against imported conversions, with the send inventory documented.

Mailgun → Customer.io · free audit

What we check in the free audit

  • Count messages carrying the person identifier you assign
  • Follow one real conversion end to end
  • Inventory every code path that triggers a send
  • Confirm which workspace you are writing to before sending anything
  • Read the match rate, not the success message

Checked against

Your application's own record of what triggered the send, joined to the order.

Get my free conversion tracking audit

Free30 minutesNo obligation

Mailgun → Customer.io · when not to buy

When you don't need this — Mailgun → Customer.io

  • Measure identifier coverage yourself first — pull your last hundred messages and count how many carry the person identifier you assign.
  • Deliverability monitoring is the right use of Mailgun's data. Attribution belongs at the order.
  • If your messaging is scheduled rather than behavioural, a simpler email platform does the job and removes the whole class of accidental-send risk.

Mailgun → Customer.io · what we deliver

What gets built — Mailgun → Customer.io

  • Identifier capture into Mailgun

    Record the trigger reason on the message in your own system and attribute at the order.

  • Event source: your order system

    Send orders. Use Mailgun events for deliverability monitoring only.

  • Dispatch to Customer.io

    The Customer.io Track API, posted server-side from your order or product system with the person identifier and event attributes.

  • Reversals where they exist

    Refunds reverse at the order.

Written guarantee

95%+ tracking accuracy

Measured against Your application's own record of what triggered the send, joined to the order.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Mailgun → Customer.io questions, answered

It is worth considering, because the triggers become visible to marketing. Confirm your plan covers transactional sending and test deliverability on your domain first.

Free · 30 min

Get Mailgun and Customer.io joined properly

Free30 minutesNo obligation