Connecting Mailgun to your DNS manager
Create a Mailgun account
Sign up at mailgun.com and create a sending domain (e.g.,
mail.yourdomain.com).Get your DNS records from Mailgun
In your Mailgun dashboard, navigate to Sending > Domains and select your domain. Mailgun will show you the DNS records to add.
Add DNS records to your registrar
Log in to your DNS manager (e.g., GoDaddy, Cloudflare, Namecheap) and add the following records:
| Type | Name | Value |
|---|---|---|
| TXT | mail.yourdomain.com | Mailgun SPF record |
| TXT | k1._domainkey.mail.yourdomain.com | Mailgun DKIM record |
| CNAME | email.mail.yourdomain.com | mailgun.org |
| MX | mail.yourdomain.com | mxa.mailgun.org (priority 10) |
| MX | mail.yourdomain.com | mxb.mailgun.org (priority 10) |
Verify in Mailgun
Return to your Mailgun domain settings and click Verify DNS Settings. DNS propagation may take up to 48 hours.
Setting up replies in Mailgun
When contacts reply to emails sent through Mailgun, you need to configure routes in Mailgun so those replies are delivered back into the platform.Create a new route
Click Create Route and set up a filter expression to match inbound emails to your sending domain.
Set the action
Set the action to Forward and enter the inbound webhook URL provided by the HoopAI Platform.
The inbound webhook URL for Mailgun routes is available in Settings > Email Services > Mailgun in the HoopAI Platform.
Unsubscribe settings in Mailgun
Mailgun automatically adds an unsubscribe link to emails when the feature is enabled. You can customize unsubscribe behavior in both Mailgun and the HoopAI Platform.To change unsubscribe settings in Mailgun
Go to sending settings
In your Mailgun dashboard, navigate to Sending > Domain Settings and select your domain.
Mailgun suppressions and DND
When a contact unsubscribes, bounces, or marks an email as spam through Mailgun, the HoopAI Platform automatically updates the contact’s Do Not Disturb (DND) settings for email:| Mailgun event | DND behavior |
|---|---|
| Permanent bounce | Email DND enabled automatically |
| Spam complaint | Email DND enabled — cannot be removed by user |
| Unsubscribe | Email DND enabled |
| Soft bounce (30003, 30005, 30006) | Temporary DND |
Error codes library — Mailgun
4xx — Temporary failures
4xx — Temporary failures
These are soft bounces that Mailgun will retry automatically. Common codes include 421 (service temporarily unavailable) and 450 (mailbox unavailable).
5xx — Permanent failures
5xx — Permanent failures
These are hard bounces. The address is invalid or the receiving server has permanently rejected the message. Remove these addresses from your list. Common codes include 550 (user unknown), 551 (user not local), and 552 (mailbox full — permanent).
SMTP error: 30003, 30005, 30006
SMTP error: 30003, 30005, 30006
These codes indicate the receiving carrier is temporarily unable to deliver the message (SMS context, but also seen in email relay failures). These result in temporary DND.
SMTP error: 30004
SMTP error: 30004
Permanent delivery failure — the message was blocked by the carrier or recipient. Results in permanent DND.
.png?fit=max&auto=format&n=EQK5eX9kTD8NzWwA&q=85&s=878008bf159fcc4964d0c0d508b6e400)
.png?fit=max&auto=format&n=EQK5eX9kTD8NzWwA&q=85&s=e7fddd192d86dd299bb26a190e6a7e96)