iNewsletter can automatically send a webhook to a URL you specifiy when a newsletter is published. This can be used to create a custom integration, like posting the newsletter to your custom blog website, or to your parent portal.
To setup the integration:
- On the Dashboard for the Publication you want to setup the integration for go to Settings > Integrations
- Click Add Webhook in the top right corner to add a new one, or click the pencil icon next to an existing one to edit
- In the popup window that appears, add or update your webhook URL and name
- Click Save & Close
You can add multiple webhooks to each publication. Webhooks will continue to run until you delete them.
When a newsletter is published the URL you specify will be sent a HTTP POST with the following JSON body:
{
"event": "Publish",
"namespace": :"newsletters/issue",
"data": {
"issue": {
"name": "<issue name>",
"url": "<issue url>"
},
"publication": {
"name": "<publication name>"
}
}
}