Integration Guide
Discord Integration
Get email notifications delivered directly to your Discord channels. Choose between our full-featured bot or simple webhook integration.
Integration Methods
Discord Bot
Recommended
Full-featured bot with slash commands and fine-grained control
Discord Webhook
Simple webhook URL-based notifications
Discord Bot Integration
The Discord Bot integration provides the richest experience with slash commands, multiple channel support, and granular notification settings.
Step 1: Add the Bot to Your Server
- Go to Dashboard → Hooks
- Click Add Hook
- Select Discord Channel
- Click Add to Discord
A Discord authorization window will open. Select the server you want to add the bot to and authorize it.
Step 2: Connect Your Server
After adding the bot, you'll receive a connection code. In your Discord server:
- Go to any text channel where the bot has access
- Run the slash command:
/mailhooks connect YOUR_CONNECTION_CODE- The bot will confirm the connection
Step 3: Configure a Channel
You can configure channels either through the dashboard or Discord commands.
Option A: Dashboard
- Go to Hooks → Discord tab
- Click Add Channel
- Select server and channel
- Configure notification options
- Click Save
Option B: Discord Commands
In the channel where you want notifications:
/mailhooks setupOr filter by domain:
/mailhooks setup domain:example.comNotification Options
Domain Filter
Only receive emails for a specific domain
Show From/To
Display sender and recipient
Show Preview
Include email body preview
Show Attachments
List attachment names and sizes
Show Headers
Include full email headers
Attach EML File
Attach the original email file
Available Slash Commands
Command | Description |
|---|---|
| Link your server to Mailhooks |
| Configure the current channel for notifications |
| Configure with domain filter |
| View current configuration |
| Send a test notification |
| Remove the bot connection |
Discord Webhook Integration
For simpler setups, you can use Discord's built-in webhook feature.
Step 1: Create a Discord Webhook
- Open your Discord server
- Go to Server Settings → Integrations → Webhooks
- Click New Webhook
- Choose the channel for notifications
- Copy the Webhook URL
Step 2: Add the Integration
- Go to Dashboard → Discord Integrations
- Click Add Discord Integration
- Fill in the form:
Name — A friendly name (e.g., "Order Notifications")
Webhook URL — Paste the URL from Discord
Domain — (Optional) Filter to a specific domain
Mention Role ID — (Optional) Role to @mention
- Click Create
Step 3: Test the Integration
Click the Test button next to your integration to send a sample message and verify it's working.
Notification Content
Email notifications include:
- Subject — Email subject line
- From — Sender email address
- To — Recipient email address
- Preview — First portion of email body
- Attachments — List of files with sizes (if enabled)
- Headers — Full email headers (if enabled)
- Authentication — SPF/DKIM/DMARC status indicators
Authentication Status Icons
Passed
Failed
Soft fail / Neutral
Not checked
Domain Filtering
Both integration types support domain filtering:
- All Domains — Receive notifications for any email
- Specific Domain — Only receive emails sent to that domain
This is useful for routing different email addresses to different channels:
Domain | Channel |
|---|---|
#orders | |
#support | |
#alerts |
Troubleshooting
Bot not responding to commands
- Ensure the bot has permission to read messages and use slash commands in the channel
- Check that the bot is online (green status indicator)
- Try running
/mailhooks statusto verify connection
Not receiving notifications
- Verify the channel configuration is Active in the dashboard
- Check that domain filtering isn't blocking your emails
- Review the Logs for delivery errors
- Ensure the bot has permission to send messages in the channel
Webhook errors
- Verify the webhook URL is correct and hasn't been deleted
- Test the integration using the Test button
- Check the logs for specific error messages
Rate limiting
Discord has rate limits on webhooks and bots. If you're receiving many emails, consider:
- Filtering to specific domains
- Using the bot integration (higher limits than webhooks)
Bot vs Webhook Comparison
Feature | Bot | Webhook |
|---|---|---|
Setup complexity | Medium | Simple |
Slash commands | ||
Multiple channels | Easy | Separate webhooks |
Field visibility control | Limited | |
Attach EML files | ||
Mention roles | ||
Domain filtering | ||
Delivery logs |