Postmastery supports SendGrid clients with multiple webhook endpoints

Postmastery provides delivery monitoring and optimisation services on top of various email delivery environments. Sometimes we offer this service on top of on-premises MTA (like PowerMTA or EmailSuccess) and sometimes on top of cloud-based ESP’s (like Mailchimp or Smartfocus). A prerequisite of delivery monitoring and optimization services, is to get the right data points like SMTP-data, blacklist data, DMARC-data or FBL-data in place. In some cases it is difficult to get the SMTP data for our clients who use SendGrid. Not so much because they do not provide the data, but because SendGrid only supports one endpoint which is often already in use for retrieving bounce data by the users. We, Postmastery, need at least one other endpoint to retrieve similar data as well. For this reason, Postmastery has decided to develop a template to deploy a webhook forwarder on Google Cloud Platform.

Webhook forwarder

Developers at Postmastery studied various webhook forwarder options. New ‘serverless’ cloud products are ideal for this. By using Google Cloud Functions and Google Cloud Pub/Sub, Postmastery was quickly able to create a forwarder. It is documented on Github.

UPDATE: A similar solution was developed for Amazon AWS. See this repository on Github.

How does it work?

As mentioned, the template leverages Google Cloud Functions and Google Cloud Pub/Sub to provide scalability, reliability, and separation with minimal code.
The endpoint function receives HTTPS POST requests from a webhook and publishes the messages to a Pub/Sub topic. The subscriber function is subscribed to the Pub/Sub topic and forwards the messages to a specific URL. Multiple subscriber functions with different URLs can be deployed, which all get the same messages.
Through Pub/Sub the endpoint is decoupled from the subscribers. As soon as the message is saved in the queue, incoming messages are immediately acknowledged. If forwarding to a receiver fails, the message remains in the queue and the subscriber function is retried.

More information?

Postmastery is happy to discuss setting up. Just send us a note via our contact page.

Share this

Comments are closed.

There are many more interesting blogs by category for you to read.