Extract Postmark MessageID

How do I extract the message ID after sending an email please?

I’m using the Postmark plugin By @vini_brito

Any help greatly appreciated

Hi! This plugin currently doesn’t make it available, but I plan on making it so soon.

1 Like

Oh brilliant thank you.

Quick question: I’ve set up an api for the message details…do you think if I search for sender, recipient and subject I’ll get a good enough match?

You are so close if you have the API’s working, why not just try to set up your own API to send the message itself? At least until the plug-in is updated?

When you send the message via API, it should return among other things like errors, the message id.

It would be easy to test on the Postmark API page.

So scared lol, literally set up my first api today (thanks to you) and have cold sweats just thinking about doing more. But will take a look as am sure the more I do the more confident I’ll get. Thanks @ratsoundsystems

I will see if I have time later today to setup an example API -Post to send a message and return the ID and errors.

1 Like

I wish Postmark would let you send blank Bcc, Cc, etc. and it would just ignore them so the API call can just be setup with all the possible fields.

Instead if you send "Bcc":"", it errors out saying can’t be blank. As a workaround I had to put <Bcc> in the JSON body then the dynamic value having to be "Bcc":"[value]", IF I have a Bcc recipient.

Seems @vini_brito 's plugin conveniently just puts that in if there is at least one Bcc item

Unless I’m missing something might be confusing to people setting up the API call.

1 Like

Thank you, really appreciate your help

Thanks for this, will keep it in mind when I attempt it

image

1 Like

Yea yea plugins are useful, what else is new

We out here

1 Like

The plug in is for sure useful, I use it.
But in this case the OP needs the Message ID, and that is useful too.

The only things the API requires for sending is: Sender, Subject, Recipient, and Body (HTML or text). The rest are optional.

The problem with blank BCC and CC I suspect: if you have a parameter you pass, like “BCC” = “”
It cannot be empty if you include it.
The plugin probably handles this, it does not pass in the API call the empty parameters which then generates an error.

One way around this which might not be too graceful, is to have a few different Posts with each customized and triggered based on if the BCC and/or CC is empty.

This might be too much work and not worth it in the end, but it should work fine.

According to the Postmark docs, the Message ID is definitely returned, and then the OP would have a great way to track message status, opens, etc

1 Like

OK this might be WAY more work than it is worth it for the OP, but I went ahead and setup and tested a basic Postmark API send an email with just: Subject, Sender, Recipient, Body.

One thing I did not know before: for security, Postmark requires senders to be registered with a “sender Signature” to send messages. When I tried it using my personal email, I got an error. When I used my apps admin email address, which is used often, no problem. So each sender would in an app would need a separate call first to “Create A Signature”. I imagine one could setup a backend workflow to add this each time a new user signs up. Again, lots of work!

Here is what the API post looks like:

And here is what came back:

So, to the OP. If you really need those message ID’s. If you send a message with a similar post, you can then in your workflow after the Post Action step do something like:
Create a new Thing - Sent Messages.
Sender = Current User
Message ID = Result of Step 1 - Send An Email 's body Message ID

Oh, and there are a ton more parameters you can add, like BCC, CC, Reply To
For tracking purposes add:
“TrackOpens”: true,
“TrackLinks”: “HTMLOnly”,

Your best bet though, probably wait for the plug-in to be updated!
(Oh, and I did get the email to my account so it for sure worked.)

1 Like

Thanks so much. @ratsoundsystems you are a legend for doing this.

I have a LOT of users who use gmail etc so looks like I’m going to have to stick with what I have and look forward to @vini_brito updating the plugin.

Everyone’s help is really appreciated, and for someone with less experience I really appreciate both sides of the story in relation to APIs and Plugins! Both clearly have their pros and cons and it’s great to hear both :raised_hands:

This topic was automatically closed after 70 days. New replies are no longer allowed.