Mailgun Webhooks
Email delivery service. Receive events for deliveries, bounces, complaints, opens, and clicks.
Connecting Mailgun to Hookbase
Create a source in Hookbase first — it gives you an ingest URL to paste into Mailgun. Then:
- 1In the Mailgun Control Panel, go to Sending → Webhooks and pick your domain
- 2Click "Add webhook" and choose the event type
- 3Paste your Hookbase ingest URL and save
- 4Go to Settings → API Security and copy the HTTP webhook signing key (not your API key or domain sending key)
- 5Paste the HTTP webhook signing key into your Hookbase source
Signature verification
Set the source's provider to mailgun and paste the signing secret. Every request is checked before the event is stored, and anything that fails is rejected rather than quietly recorded.
- Algorithm
- HMAC-SHA256
- Header
- signature (in POST body)
- Where to find the secret
- Mailgun Control Panel → Settings → API Security → HTTP webhook signing key
Mailgun event types
8 of the events people route most often. Hookbase accepts every event Mailgun sends, whether or not it is listed here.
delivered
A message was delivered
opened
A message was opened
clicked
A link in a message was clicked
bounced
A message bounced
complained
A recipient marked message as spam
unsubscribed
A recipient unsubscribed
failed
A message delivery failed permanently
stored
A message was stored (inbound)
What a Mailgun webhook looks like
A delivered payload. Hookbase stores the raw body exactly as it arrived, so this is also what you get back on a replay.
{
"signature": {
"timestamp": "1678901234",
"token": "abc123def456",
"signature": "hmac-hash-here"
},
"event-data": {
"event": "delivered",
"timestamp": 1678901234,
"id": "msg-abc123",
"recipient": "user@example.com",
"tags": [
"welcome"
],
"message": {
"headers": {
"message-id": "msg-id-123@mailgun.org",
"subject": "Welcome!"
}
},
"delivery-status": {
"code": 250,
"message": "OK"
}
}
}Start receiving Mailgun webhooks
Create a source, paste the URL into Mailgun, and watch the first event arrive. The free tier includes 1,000 events a month.
Get Started Free