The Basics of Webhooks
Webhooks are user-defined HTTP callbacks that are triggered by email events. These events are things like a successful email delivery or a link clicked in an email. Whenever an event is triggered, a post request is sent to the URL that is configured to receive the webhook data. This data can be used by multitude of different things. You could trigger an offer to customers “event” in your application or store data. A popular use of webhooks is to obtain data in real-time, including message effectiveness or engagement.
Webhooks are also referred to as reverse-APIs as they send information to your applications on a real-time basis, without having to ask for the data.
Email Events and Types of Webhooks
You can trigger multiple events per email sent. For example: email delivered, email bounced, email opened, email clicks. These are all events that can be tracked by email service providers such as Pepipost.
Email Delivery Webhooks are events that occur during delivery stage. They include email delivered, bounced or dropped (hard bounces or email failed to delivered due to continued soft bounces.) You can get answers to questions by configuring your webhooks:
- Was the email successfully delivered to the inbox or did email delivery fail?
- Did the email bounce? If so, was it a soft bounce or a hard bounce?
Other events such as opens, clicks, subscribes and complaints occur after the email has been delivered. These can be termed as Recipient Engagement Webhooks. Setting up these webhooks will help you determine:
- If the recipient open his / her email
- Whether the recipient clicked within the email
- If there was an unsubscribe
Common Parameters / Data sent via Webhooks
All webhooks have common parameters or data that is sent across for every event being triggered. These parameters include:
- Event type (open, click, delivered etc.)
- Recipient who triggered the event
- Common message header that includes Message ID, Tags, Campaign ID.
- Sending domain
- Recipient engagement details such as country in which the email was opened, device, email client used by recipient – Gmail, Yahoo etc, and the operating system of the recipient.
Setting up a Webhook with Pepipost
Pepipost provides webhooks as a feature to extend your custom application by utilizing data from our system. When you send transactional emails to your customers using the Pepipost platform, a lot is happening at the back end. Our webhooks are a convenient way to facilitate quick information exchange with your application. Here are the basic steps to configure a webhook with Pepipost:
- Select the data you want to use: First and foremost, you need to drill down to the data that your application would need from our platform. Do you want to track email delivery or email engagement? Accordingly, make a list of the metrics and events that need to be triggered and configured with our webhooks.
- Setup the URI: Next, you need to setup / configure the URL. In order to receive webhook data, you need to configure a URI that can receive this data. Moreover, you need to point this URI to your application, which would be the end-point of data consumption.
- Write scripts to capture data: In your application, you need to write scripts to consume data from the URI and utilize it as required.
- Configure URI in Pepipost: Finally, you need to configure the Call back URL in Pepipost to start sending data to your application via POST. Our webhooks allow you to sync-up with subscribers activities and receive real-time HTTP POST call-backs.
Using webhooks from your ESP? Keep these points in mind
There are multiple aspects that you must remember to ensure that your applications are utilizing webhooks to the fullest.
- Webhooks might stop forwarding requests at times. They might even forget to handle a request after generating it. This means that your Webhook has a configuration error. You must correct it as soon as possible to avoid loss of data. Pepipost filters out such requests quickly and avoids data duplicacy.
- You cannot ascertain how many requests will come to your app. Therefore, you must test whether your webhook can handle a large number of requests. You can check this well in advance so that your app does not stop functioning if there are a large number of incoming requests.
In conclusion, it is important to understand how a typical email webhook works, so that you can derive the maximum benefit out of it. Use Pepipost webhooks to receive real-time data about email delivery and email engagement in your application and procure actionable insights into your email marketing campaigns.
Find out more about our features!