Transactional Email · Integration
Mailgun
Add Mailgun to your product for your customers, and give your AI agents governed access to it.
Mailgun is a sending API rather than a campaign tool, so the objects that matter are the message, the domain it was sent from, and the event stream that says what happened to it. Deliverability lives almost entirely in that last part: bounces, complaints and unsubscribes are suppression state, and a product that sends without reading them back will keep mailing addresses that already hard-bounced. Domains are the tenancy boundary, since sending reputation attaches to the domain rather than the account, which is why each of your customers should be sending from their own. Events arrive as a stream and can be replayed, so the integration should treat them as a feed rather than a query. fastn scopes the credential per customer and keeps the upkeep off your backlog.
In your product
Embedded for your customers. Per-tenant auth, no per-customer code, maintained by fastn.
Let a customer connect their own Mailgun account so your product sends from their domain and their reputation, not yours.
Send transactional messages from your product with per-tenant credentials rather than one shared key.
Read delivery, bounce and complaint events back so your product stops mailing an address that already failed.
Manage suppression lists per customer, which is the part deliverability actually turns on.
For your AI agents
Governed, audited access for the agents you build, through the MCP server.
An agent reads recent delivery events and explains why a message did not arrive.
An agent removes an address from a suppression list within governed permissions, with the write audited.
An agent reacts to a spike in bounces and reports which domain and which template it came from.
Example prompt
Show the messages that bounced in the last day and group them by domain and reason.
Set up Mailgun in 4 steps
- 01Enable the Mailgun connector from your fastn dashboard.
- 02Have each customer authorise their own Mailgun account, so calls run under their credentials rather than a shared key.
- 03Decide which messages, templates and delivery events your product needs, map those fields, then enable the actions and triggers you want.
- 04Call it from your product and expose it to your agents through the same governed connection.
Why teams use the Mailgun integration
What you get by embedding it with fastn instead of building it yourself.
- Ship a Mailgun integration without building it. Your customers connect their own Mailgun account inside your product and work their messages, templates and delivery events there, with no per-customer code on your side.
- Handle the part that actually costs time: deliverability is the whole game, and it is decided by bounces, complaints and the reputation of the sending domain rather than by anything in the send call. fastn owns the auth, token refresh, rate limits, pagination and breaking-change fixes, so a Mailgun update is not your on-call problem.
- One integration serves your product and your agents. The same governed Mailgun connection powers in-product features and gives AI agents scoped, audited access, so you send the mail your product owes its users and know what happened to it without wiring it twice.
Used by these teams
Compare with
Works well with
Often used alongside
Tools the same teams tend to run next to Mailgun, across other categories.
Mailgun integration FAQ
How do I add a Mailgun integration to my product?
Enable the Mailgun connector in your fastn dashboard, then let each customer authenticate their own Mailgun account. fastn handles the OAuth flow, token storage and refresh per tenant, so there is no Mailgun client code in your app and no per-customer branch in your codebase. Setup is 4 steps.
Do my customers each connect their own Mailgun account?
Yes. Every connection is scoped to the individual customer, so each authorises their own Mailgun account and only ever sees their own messages, templates and delivery events. That per-tenant isolation is the point of an embedded integration: you support the long tail of customer setups without maintaining an integration per customer.
Can AI agents use this Mailgun integration?
Yes. The same connection is exposed to your agents through the fastn MCP gateway, with permissions scoped per tenant and every call audited. An agent reads recent delivery events and explains why a message did not arrive.
Who maintains the Mailgun integration?
fastn does. When Mailgun changes an endpoint, deprecates a field or alters its auth, the fix lands in the connector rather than in your backlog, and your customers' connections keep working.
Can each customer send from their own domain with Mailgun?
Yes, and it is the reason to do this per tenant rather than through one shared key. Sending reputation attaches to the domain, so a customer sending from their own verified domain in Mailgun carries their own deliverability rather than inheriting yours or damaging it.
How do bounces and complaints come back from Mailgun?
As records rather than log lines. Hard bounces, spam complaints and unsubscribes become suppression state you can read per tenant, so your product can stop mailing an address that already failed instead of sending into a hole and quietly burning the customer's sending reputation.
What can I build with the Mailgun integration?
A common starting point: let a customer connect their own Mailgun account so your product sends from their domain and their reputation, not yours. Teams also use it for the other use cases listed above, and expose it to agents for governed reads and writes.
How much does the Mailgun integration cost?
It is included. Pricing is based on connected accounts, not on how many connectors you enable, so adding Mailgun does not change your per-connector cost. You can start free with 3 connected accounts.
Add Mailgun to your product
Start free with 3 connected accounts. No sales call required, and no per-customer integration code.