Forum Academy Marketplace Showcase Pricing Features

Postmark Webhook - Metadata

Hi there,

I am using the Postmark API in my application to send out various transactional emails to clients, which is working great. However, the issue I am trying to solve is highlighting to my users when there is an action on the email they sent i.e. bounce/open/delivery.

A typical example of a problem I am trying to overcome would be that a user emails a client about a case, and then a note is created against the case to confirm successful delivery of the email.

To overcome this, I have set up a webhook with a backend workflow which creates a ‘note’ in my application. So that I can relate the webhook to a specific ‘case’ I am trying use the unique reference of the ‘case’ in the metadata in the email (as per the documentation https://postmarkapp.com/developer/webhooks/delivery-webhook).

I can send the email with the relevant metadata

Screenshot 2021-11-22 at 14.31.08

The email then sends and I can see the succesful delivery in Postmark with the metadata

However, in the workflow I can only see a metadata example

I have tested this in the workflow to see if it returns any data, but it doesn’t. I have looked at using Tags for this, but I am already using that for something else.

Any help would be greatly appreciated!

Thanks

hey Michael

Try to initiate the webhook not with test data but with live data.

So you will need to change the webhook to contain /initialize, listen for data, and send the json response you would like to have and then again updating the webhook to the one without /initialize in postmark.

Hope it makes sense!

Hi @bartek.dev makes sense, but I am struggling to do that via Postmark.

Below is the screenshot from the Postmark webhook setup screen which shows the metadata example, but I am not aware of another way to initiate the webhook?

Hi @bartek.dev, I have answered my own question regarding initiating the webhook by running it in Postman. Will take a bit of trial and error but the information is coming through now

Thank you for the nudge in the right direction!

I don’t think you need postman for this. Try to send the webhook from Postmark as you would if everything is setup (but set it up with /initialize but don’t send test data) - initiate the flow and just listen for live data.

But you get the idea, you have to initialize the webhook with the live json structure not with the test one.