> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brew.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Mailgun

> Export email templates from Brew straight into Mailgun for transactional and marketing sends, so design happens here and delivery stays there.

Connect your Mailgun account to export email templates created in Brew directly to your Mailgun domain. No manual copy-pasting, just design in Brew and export to Mailgun in one click.

<Frame>
  <img src="https://mintcdn.com/brew-796f053a/PUK-uvvrJtpQ2VX2/images/integrations/MailGun_OG.png?fit=max&auto=format&n=PUK-uvvrJtpQ2VX2&q=85&s=1ee861ee2131e7c2050cdf80c0a75b98" alt="Mailgun Integration" className="w-full rounded-xl" width="1024" height="571" data-path="images/integrations/MailGun_OG.png" />
</Frame>

## Setup

<Steps>
  <Step title="Open the Mailgun integration in Brew">
    In Brew, go to **Integrations** and click the **Mailgun** card.
  </Step>

  <Step title="Copy your domain name">
    In Mailgun, go to **Sending → Domain Settings**. Copy your domain name and paste it into the first field in Brew.
  </Step>

  <Step title="Copy your Private API Key">
    Click your **profile icon** in the top right corner, then go to **API Security**. Click the **eye icon** next to your Private API Key to reveal it, then copy it.
  </Step>

  <Step title="Paste and Connect">
    Go back to Brew, paste the API key into the second field, and click **Connect**.
  </Step>
</Steps>

That's it. Mailgun is now connected to Brew.

## Exporting a Template

Once connected, you can export any email to Mailgun:

1. Open an email you've created in Brew
2. Click **Send**
3. Choose to **export the template to Mailgun**
4. Give it a name and click **Export**

The template appears in Mailgun under **Send → Sending → Templates**, ready to use.

## Requirements

* A Mailgun account with a verified domain
* Your domain name (found under Sending → Domain Settings)
* Your Private API Key (found under Profile → API Security)

<Snippet file="need-help.mdx" />
