Setup your webhook
In Mailtarget webhook menu, you can push message events directly to your endpoints easily. But you need to manage your endpoints here, click Create Webhook button.
Follow & complete the steps to add your webhook in Mailtarget. Place your webhook name, target URL, receiving activity source, and you can choose what activity that you want to track. All activity or selected activity it depends on your needs, but Mailtarget can track:
Bounce
Delay
Injection
Open
Click
Delivery
And then you can set up the authentication method:
None = The target URL does not have an authentication scheme
Basic auth = The username and password associated with the target URL is passed though the header during the request. If you choose basic auth, you need to put username and password for the authentication
After create your webhook, the default status will be Enable. But you can change the status into Disable by click the webhook name, click Edit Webhook button and change the status to Disable.
Test your webhook
In your webhook details, there is a information about your setup lately, and there is 3 menu that you can access & try on, one of them is Test menu.
In here, you can test sending to your webhook, click the Send Test Batch button. There will be Success send test notification if the webhook success receiving the data, and there will be Failed send test notification if the webhook doesn’t receiving data.
The following is a sample webhook request:
{
"batchId": "645c2177e3b86a0001887bc6",
"retryCount": 0,
"events": [
{
"status": "injection",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"timestamp": 1460989507000
},
{
"status": "delivery",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddress": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"timestamp": 1460989507000,
"injectionTime": 1460989507000
},
{
"status": "open",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddress": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36",
"geoIp": "{\"country\":\"US\",\"region\":\"MD\",\"city\":\"Columbia\",\"latitude\":39.1749,\"longitude\":-76.8375,\"zip\":21046,\"postal_code\":\"21046\"}",
"timestamp": 1460989507000,
"injectionTime": 1460989507000
},
{
"status": "click",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddress": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"targetLinkUrl": "http://example.com",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36",
"geoIp": "{\"country\":\"US\",\"region\":\"MD\",\"city\":\"Columbia\",\"latitude\":39.1749,\"longitude\":-76.8375,\"zip\":21046,\"postal_code\":\"21046\"}",
"timestamp": 1460989507000,
"injectionTime": 1460989507000
},
{
"status": "delay",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddrss": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"bounceClass": "1",
"numRetries": "2",
"timestamp": 1460989507000,
"rawReason": "MAIL REFUSED - IP (17.99.99.99) is in black list",
"reason": "MAIL REFUSED - IP (a.b.c.d) is in black list",
"injectionTime": 1460989507000
},
{
"status": "bounce",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddress": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"bounceClass": "1",
"numRetries": "2",
"timestamp": 1460989507000,
"rawReason": "MAIL REFUSED - IP (17.99.99.99) is in black list",
"reason": "MAIL REFUSED - IP (a.b.c.d) is in black list",
"injectionTime": 1460989507000
},
{
"status": "spam_complaint",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddress": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"fbType": "abuse",
"reportBy": "server.email.com",
"reportTo": "abuse.example.com",
"timestamp": 1677553569000,
"injectionTime": 1460989507000
},
{
"status": "link_unsubscribe",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddress": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"timestamp": 1460989507000,
"injectionTime": 1460989507000,
"targetLinkUrl": "http://example.com",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"
},
{
"status": "list_unsubscribe",
"eventId": "92356927693813856",
"messageId": "000443ee14578172be22",
"subject": "Holiday deals are here!",
"sender": "[email protected]",
"sendingIp": "18.236.253.72",
"recipient": "[email protected]",
"recipientMeta": "{\"customKey\":\"customValue\"}",
"ipAddress": "18.236.253.72",
"mailboxProvider": "Gsuite",
"recipientDomain": "example.com",
"recipientType": "cc",
"timestamp": 1460989507000,
"injectionTime": 1460989507000
}
]
}
Webhook Batch Status
The Mailtarget webhook Batch Status menu to display the status of the webhook that you have connected to Mailtarget. This menu will provide details regarding data on delivery time or sending time to the webhook, batch ID, status, attempts and responses received from your webhook.
Please note that if your webhook fails, the system will retry sending it up to 7 times. If it continues to fail, you will receive an automatic email notification to resolve the issue. If no fix is made within 7 hours, the webhook will be deactivated.