Email event webhooks are a way to receive real-time notifications about email events, such as when an email is delivered, opened, clicked, bounced, or marked as spam. They work by sending an HTTP POST request to a URL you specify whenever a specific event occurs in Xeams. This allows you to monitor your email campaigns and respond to events instantly, rather than constantly checking for updates through traditional APIs like IMAP or POP3.
To configure a webhook in Xeams, go to Home > Plugins > Event Webhooks. The following table defines every field on this page:
Friendly Name | Any arbitrary value that is used to identify this webhook |
---|---|
Post URL | The URL endpoint that is called when an event occurs. Please refer to the section below for more details on creating this endpoint. |
Payload Type | This can be either JSON, XML, or Form-Data. Further explanation is provided below. |
Since Xeams can handle both inbound and outbound emails, trigger events are generated in both directions. For example, many services that only process outbound emails cannot create an event for a replied email because replies to the original email never go through their server. Xeams supports the following events:
A URL endpoint can be created on any web server, provided it can be reached from the machine where Xeams is running. Since most instances of Xeams run within your network, these URLs can be used to access web servers on your LAN, eliminating the need for any firewall configuration.
You can use any web server or programming language to implement this endpoint.
Xeams supports multiple types of payloads:
application/json; charset=utf-8
text/xml; charset=utf-8
application/x-www-form-urlencoded; charset=utf-8
Regardless of the type of payload you choose, the data remains the same. It contains the following fields:
NDR event in JSON
{ "cc": "jane.doe@example.com", "envelopeRcptTo": "john.doe@example.com", "headers": "U3ViamVjdDogVGVzdGluZyAxMjMNCkZyb206IGphbmVAbXljb3JwLmNvbQ0KVG86IGpvaG4uZG9lQGV4YW1wbGUuY29tDQo=", "msgType": "G", "envelopeMailFrom": "jane@mycorp.com", "subject": "Testing 123", "ipAddress": "10.11.12.13", "eventType": "NDR", "mimeBody": "", "body": "This is a sample body of the message.", "dateReceived": "1752317412578", "from": "jane@mycorp.com", "to": "john.doe@example.com" }
Note: The mimeBody is blank in every event but Received.
Received event in JSON
{ "cc": "jane.doe@example.com", "envelopeRcptTo": "john.doe@example.com", "headers": "U3ViamVjdDogVGVzdGluZyAxMjMNCkZyb206IGphbmVAbXljb3JwLmNvbQ0KVG86IGpvaG4uZG9lQGV4YW1wbGUuY29tDQo=", "msgType": "G", "envelopeMailFrom": "jane@mycorp.com", "subject": "Testing 123", "ipAddress": "10.11.12.13", "eventType": "Received", "mimeBody": "U3ViamVjdDogVGVzdGluZyAxMjMNCkZyb206IGphbmVAbXljb3JwLmNvbQ0KVG86IGpvaG4uZG9lQGV4YW1wbGUuY29tDQoNClRoaXMgaXMgYSBzYW1wbGUgYm9keSBvZiB0aGUgbWVzc2FnZS4=", "body": "This is a sample body of the message.", "dateReceived": "1752317412578", "from": "jane@mycorp.com", "to": "john.doe@example.com" }
Received event in XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <WebEvent> <body>This is a sample body of the message.</body> <cc>jane.doe@example.com</cc> <dateReceived>1752317844630</dateReceived> <envelopeMailFrom>jane@mycorp.com</envelopeMailFrom> <envelopeRcptTo>john.doe@example.com</envelopeRcptTo> <eventType>Received</eventType> <from>jane@mycorp.com</from> <headers>U3ViamVjdDogVGVzdGluZyAxMjMNCkZyb206IGphbmVAbXljb3JwLmNvbQ0KVG86IGpvaG4uZG9lQGV4YW1wbGUuY29tDQo=</headers> <ipAddress>10.11.12.13</ipAddress> <mimeBody>U3ViamVjdDogVGVzdGluZyAxMjMNCkZyb206IGphbmVAbXljb3JwLmNvbQ0KVG86IGpvaG4uZG9lQGV4YW1wbGUuY29tDQoNClRoaXMgaXMgYSBzYW1wbGUgYm9keSBvZiB0aGUgbWVzc2FnZS4=</mimeBody> <msgType>G</msgType> <subject>Testing 123</subject> <to>john.doe@example.com</to> </WebEvent>