Connecting Mailgun to Braze
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. Braze is mobile-first lifecycle messaging, which means it resolves to a user rather than to a click and its most valuable channels — push and in-app — exist nowhere near a browser. The join between them succeeds or fails on one thing: whether the Braze external user ID reaches the Mailgun message before the conversion happens, because Braze can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
Mailgun and Braze both emailing one customer: keep them in sync
Put your user ID, the same value as Braze's external_id, into Mailgun custom variables on every send, then use hard bounce and spam complaint webhooks to update Braze subscription state, keyed on external_id. Receipt opens and clicks rarely belong in Braze. Purchases come from your order system, not the Mailgun receipt, and each message type gets one owning system.
Most companies with both run Braze for lifecycle campaigns and Mailgun for receipts, resets and alerts sent from code. That means two systems emailing the same person with no shared view. The fix is to make Mailgun's events land on the Braze profile, and that depends on putting your own user ID, the same value you use as Braze's external_id, into Mailgun's custom variables on every send. Keyed on the email address alone, events land on duplicate or anonymous profiles.
The Mailgun events worth sending to Braze are suppression events: hard bounces and spam complaints. An address that hard-bounces from Mailgun will bounce from Braze too, and a complaint against your transactional mail hurts the reputation of the domain both systems may share. Update the Braze subscription state from the webhook, keyed on external_id. Opens and clicks on receipts rarely belong in Braze segments.
Purchases still come from your order system to Braze's track endpoint, not from the Mailgun receipt. The order and the receipt fire from the same application event, and if both feed Braze you get two purchase events and two post-purchase campaigns. Decide which message each system owns, write it down from the send inventory, and do not let a Braze campaign duplicate a receipt Mailgun already sends.
Mailgun → Braze · what breaks
Why this join usually fails — Mailgun → Braze
- 01
The Braze external user ID never reaches Mailgun
No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool.
- 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.
- 03
Duplicate events sending duplicate push notifications
A duplicate here is visible to your customer on their lock screen, twice, and the second one is the reason they turn push off permanently. This is a more expensive mistake than a double-counted conversion in an ad platform, because the damage is not recoverable.
- 04
Nothing reconciles afterwards
Braze shows events on the user profile within moments. Check the profile, not the API response, and specifically check whether an anonymous device profile has been created alongside the real one.
Mailgun → Braze · the fix
What working looks like — Mailgun → Braze
The Braze external user ID on every message
Conversions arriving in Braze
The event lands on the user profile, triggers whatever campaigns depend on it, and becomes available for segmentation across push, email and in-app.
Reconciled against the source
Mailgun → Braze · architecture
How Mailgun and Braze actually connect
- 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
Braze needs a click to match
Braze needs the external user ID and a well-named event with its properties. An event with no external ID lands on an anonymous device profile that may never merge with the real user.
- 3
The identifier is the bridge
The Braze external user ID, captured at the visit and carried into the Mailgun message.
- 4
The event source decides reliability
Send orders. Use Mailgun events for deliverability monitoring only.
- 5
Deduplication at the destination
Braze does not deduplicate for you. A purchase sent from both your app SDK and your server produces two events, two campaign triggers and potentially two push notifications to a customer who bought once.
Mailgun → Braze · normal or broken
Working vs. broken, side by side — Mailgun → Braze
Normal, not a fault
The Braze external user ID present on the message
Sent from your order system
Deduplicated correctly
Braze does not deduplicate for you. A purchase sent from both your app SDK and your server produces two events, two campaign triggers and potentially two push notifications to a customer who bought once.
Reconciles with the source
Actually broken
The Braze external user ID 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
A duplicate here is visible to your customer on their lock screen, twice, and the second one is the reason they turn push off permanently. This is a more expensive mistake than a double-counted conversion in an ad platform, because the damage is not recoverable.
Nobody has reconciled it
Mailgun → Braze · diagnose
Diagnostic order — Mailgun → Braze
- 01
Count messages carrying the Braze external user ID
- 02
Follow one real conversion end to end
- 03
Inventory every code path that triggers a send
Usually the first time anyone has, and it frequently finds sends nobody remembers building.
- 04
Send a test purchase and read the user profile's event stream
One event or two? Check whether the SDK is already sending the same event before adding a server source, and check that the external ID matches the signed-in user rather than creating a new profile.
- 05
Read the match rate, not the success message
Braze shows events on the user profile within moments. Check the profile, not the API response, and specifically check whether an anonymous device profile has been created alongside the real one.
Mailgun → Braze · prove
How it gets proven — Mailgun → Braze
Source of truth
Your application's own record of what triggered the send, joined to the order.
- The Braze external user ID confirmed present on a live message.
- The user profile confirmed to show one event per conversion, with device and user profiles correctly merged.
- Orders reconciled against imported conversions, with the send inventory documented.
Mailgun → Braze · free audit
What we check in the free audit
- Count messages carrying the Braze external user ID
- Follow one real conversion end to end
- Inventory every code path that triggers a send
- Send a test purchase and read the user profile's event stream
- Read the match rate, not the success message
Checked against
Your application's own record of what triggered the send, joined to the order.
Free30 minutesNo obligation
Mailgun → Braze · when not to buy
When you don't need this — Mailgun → Braze
- Measure identifier coverage yourself first — pull your last hundred messages and count how many carry the Braze external user ID.
- Deliverability monitoring is the right use of Mailgun's data. Attribution belongs at the order.
- If you have no mobile app and no push channel, Braze is a large piece of infrastructure for a job an email platform already does.
Mailgun → Braze · what we deliver
What gets built — Mailgun → Braze
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 Braze
The Braze user track endpoint, posted server-side from your order or billing system with the external user ID and event properties.
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.
From $400 · See packages
FAQ
Mailgun → Braze questions, answered
Handle Mailgun's bounce and complaint webhooks and update the matching Braze user by external_id. Include your user ID as a custom variable on each Mailgun send so the webhook can find the profile.
Only if you want marketing to see and edit them. Keeping receipts in Mailgun is fine, as long as each message has one owner and suppressions sync between the two.
Almost always because the Braze external user ID never reached the Mailgun message. No session, no click, and the trigger conditions are buried in application code rather than in a campaign tool. Measure coverage before debugging the dispatch.
Braze identifies people by an external_id you assign, usually your own user ID, with anonymous device profiles merged in once a user signs in. There is no click identifier at all. Getting the external ID right is the entire integration; getting it wrong fragments one customer into several profiles who each receive the same campaign.
Your order system. Send orders. Use Mailgun events for deliverability monitoring only.
Braze shows events on the user profile within moments. Check the profile, not the API response, and specifically check whether an anonymous device profile has been created alongside the real one.
More on Mailgun → Braze
- Stripe → BrazeConnecting Stripe to Braze
- PayPal → BrazeConnecting PayPal to Braze
- Shopify → BrazeConnecting Shopify to Braze
RELATED GUIDES
Where Mailgun → Braze fits in the rest of your tracking
- SendGrid → BrazeConnecting SendGrid to Braze
- Postmark → BrazeConnecting Postmark to Braze
- Resend → BrazeConnecting Resend to Braze
- Mailgun → IterableConnecting Mailgun to Iterable
- Mailgun → KlaviyoConnecting Mailgun to Klaviyo
- SaaSConversion tracking for SaaS, from signup through to the payment that matters
Free · 30 min
Get Mailgun and Braze joined properly
Free30 minutesNo obligation
