This setup guide is if you have Mailgun already and want to integrate it with OneSignal. If you don’t have a Mailgun account, you can use OneSignal Email instead.
Requirements
- Mailgun Account
- Mailgun US API (EU region is not supported)
- OneSignal Account
- A domain you own and access to its DNS provider
Setup
1. Add a new domain in Mailgun
Skip this step if your domain is already set up in the US region.- Go to the Domains page in the Mailgun dashboard.

Navigate to the Domains page
- Click Add new domain.

Open Add New Domain form
- Enter a subdomain (e.g.,
mail.yourdomain.com
) and ensure the region is US.

Specify subdomain and select US region
2. Verify DNS settings
Mailgun provides the following DNS records:- 2 TXT (SPF & DKIM)
- 2 MX
- 1 CNAME
- Go to Mailgun > Sending > Domain Settings > Your Domain > DNS Records
- Look for green checkmarks next to each record

Verify DNS setup
If CNAME is not set correctly, email click, open, and unsubscribe tracking will not work.
3. Set up SMTP credentials
- Go to Sending > Domain Settings > SMTP credentials in Mailgun.

Navigate to SMTP Credentials
- Click Add new SMTP user.

Add new SMTP credentials
- Set a login name and save the credentials.

Create SMTP user
- Click the copy icon to save the password securely.

Copy SMTP password
4. Get a Mailgun API key
- In the Mailgun dashboard, scroll to the bottom and click API Keys.

Navigate to API Keys
- Click Add new key

Add new key
- Name the key and click Create Key.

Create key
- Copy the generated API key and save it securely.

Copy API key
5. Configure Mailgun in OneSignal
- In OneSignal, go to Settings > Platforms > Email and choose Mailgun.

App setup email
- Select Mailgun as the provider.

App setup email
- Enter:

Configure provider
- Set default sender name and
from
email address.

Configure additional settings
6. Add OneSignal webhooks to Mailgun
Navigate to Mailgun > Sending > Webhooks > Your Domain > Webhooks and add:
Add webhook
7. Change tracking protocol to HTTPS
Ensure recipients are directed to secure URLs.- Go to your domain settings in Mailgun.
- Under Tracking > Tracking Protocol, change from HTTP to HTTPS.

Change tracking protocol
8. Send a test email
- Go to OneSignal > Messages > Email, click New Email.
- Add a subject, click Send Test Email, input your email, and hit Send Test Message.

Send test email
Troubleshooting
See our Email FAQNeed help?Chat with our Support team or email
support@onesignal.com
Please include:- Details of the issue you’re experiencing and steps to reproduce if available
- Your OneSignal App ID
- The External ID or Subscription ID if applicable
- The URL to the message you tested in the OneSignal Dashboard if applicable
- Any relevant logs or error messages
Email setup complete!
Next steps:
- Return to the Email Setup guide to explore OneSignal Email capabilities.