Webhook Notifications

cmercury sends webhook notifications for events like Delivered, Open, Click, Bounce, Unsubscribe and Spam for emails sent through trigger APIs.

Connecting a Webhook for Event Notifications of Trigger-Based APIs

To receive notifications for events such as Delivered, Open, Click, Bounce, Unsubscribe, and Spam related to emails sent via our Trigger APIs, you should have a webhook URL connected to the cmercury account. Please contact the cmercury support team at [email protected] or your account manager for getting this done.

This service is available for emails sent through the Trigger APIs namely Fire Trigger v2, Dynamic Template Trigger v2, and Attachment Trigger v2. Ensure you are using Version 2 of these APIs to receive a unique messageID in the API response.

cmercury will send POST requests to your webhook URL, which will include the messageID corresponding to the one provided in the response of the Trigger API. This allows you to map each event notification back to its respective API request within your application.

Samples for each event that will be send to your webhook is given below


DELIVERED

{  
    "messageId": "20241018014218812sdasfsaq9BdfgdPi",  
    "event": "DELIVERED",  
    "timestamp": "2024-10-18T04:50:27+00:00",  
    "email": "[[email protected]](mailto:[email protected])",  
    "message": "relayed",  
    "version": "1.0"  
}

BOUNCE

Process the bounce event and remove the email address from all future campaigns to protect your domain's reputation and to avoid account lockout.

{  
  "messageId": "20241018014218812sdasfsaq9BdfgdPi",  
  "event": "BOUNCE",  
  "timestamp": "2024-09-27T10:10:59+00:00",  
  "email": "[[email protected]](mailto:[email protected])",  
  "message": "failed",  
  "version": "1.0"  
}

OPEN

{  
    "messageId": "20241018014218812sdasfsaq9BdfgdPi",  
    "event": "OPEN",  
    "timestamp": "2024-10-18T04:54:43+00:00",  
    "email": "[[email protected]](mailto:[email protected])",  
    "message": "Opened",  
    "version": "1.0       "  
}

CLICK

The click event will have an additional Key named ClickedLink to identify the link.

{
"messageId": "20241018014218812sdasfsaq9BdfgdPi",
"event": "CLICK",
"timestamp": "2024-10-18T07:09:26+00:00",
"email": "[email protected]",
"message": "Clicked",
"version": "1.0       ",
"ClickedLink": "https:\/\/www.domain.org\/index.html?q=param"
}

UNSUBSCRIBE

The unsubscribe event will not have the messageID key. Hence process the event using email key and remove the email address from future mail activities for safeguarding your domain's reputation.

{      
    "event": "UNSUBSCRIBE",  
    "timestamp": "2024-10-18T04:54:43+00:00",  
    "email": "[email protected]",  
    "message": "Unsubscribed",  
    "version": "1.0       "  
}

SPAM

The spam event will not have the messageID key. Hence process the event using email key and remove the email address from future mail activities for safeguarding your domain's reputation.

{      
    "event": "SPAM",  
    "timestamp": "2024-10-18T04:54:43+00:00",  
    "email": "[email protected]",  
    "message": "SpamReported",  
    "version": "1.0       "  
}