If you’ve integrated the CakeMail API with your application, or are using the CakeMail API to add subscribers to your contact list, you can now sync a list on your server with real-time data.
Access data from CakeMail through the Webhooks in two easy steps:
- Create a Script on Your Server
- Set up Your CakeMail List
Once you have your script, the only thing left is to setup your CakeMail list so that it starts sending to your script. To do so, you need to call the function
List.Setinfo with the parameter ‘webhook’ => ‘[URL to your script]’.
The script can be in any language. CakeMail will post a JSON to this script whenever there is an action to your CakeMail list such as a subscription, an unsubscribe request, a spam complaint, an update to the user record, etc.
Here is the format of the posted JSON:
message => array(action, list_id, client_id, record => array(record_id, email, [fields]))
And you’re done! Now your list will be dynamically updated every time something changes. To learn more about this kind of functionality, or about integrating the CakeMail API with your own application, visit the CakeMail Developer Community.