Forum Academy Marketplace Showcase Pricing Features

Postmark Errors

Continuing the discussion from Ignore quote in Email:

Not sure if this is the same problem or not, but it is the only similar thing I have seen in the forum.

I had recently set up my app to use postmark transactional emails. It is a social networking app and I am using postmark to send emails for things like a welcome email, notifications, messages, etc.

In the beginning I struggled to set everything up, but after a few hours I got it all working. But for some reason two of the api calls just stopped working. The call to send an email when a User receives a new message and the call for a new notification. The error that shows up in the server logs is:

Workflow error - The service Postmark Message - Message just returned an error (HTTP 422). Please consult their documentation to ensure your call is setup properly. Raw error: {"ErrorCode":402,"Message":"Received invalid JSON input."}

I have checked the JSON in a validator, no issues were found, then I worked with postmark support, and nothing they could see, so I feel like this is a bubble issue. I can’t figure out what happened and would love to know if anyone else ran into a similar issue and has input on how to solve.

Can you send a screenshot of how your JSON code looks like right now?

So fast, I love it! And yes:

Are you using the default outbound stream? Or another message stream?

Default Transactional Stream, not sure if that is the same thing or not.

The actual JSON code looks right. Have you tried escaping quotes and other characters that can throw your code off?

Yeah, I have been working at it all day trying to remove spaces and characters to see if it will work to no avail. I am not a coder though, so in all honesty I am not confident enough to say for sure.

Can you send an example message of what you’re trying to pass through?

So this is what I am doing. Have it set up so that when a new message is sent from one User to another it schedules a backend workflow. Then the workflow triggers an api call for the postmark email.

The weird part is, this was all working fine yesterday, and today it randomly just stopped working for this api call and also the one for new notifications that I have.

Here are some screenshots to give some insight, hopefully this is what you meant.

I believe it’s your “message content” where the quotes need to be escaped using \”

In the workflow or the API JSON? I tried both and still have same issue :confused:

That actually led me to something though! I finally got it to work by removing all punctuations.

So it seems like having any punctuations in the workflow caused an error.

For example before I had:

As you can see there is a . at the end of company_name, and “” marks and … in the message_content.

I removed this so now it looks like:

And it seems to be working now.

Yay! Yeah, I was talking about in the Wf Action. If you still want the quotes then you can do \” to escape it

That’s what I was trying to do, but it still wasn’t working for some reason. Is it supposed to be like this?

It gives me the error again when I have it like this.

Screen Shot 2021-12-03 at 11.43.07 AM

You need it For both quotes

The one that the beginning and end

Still shows the error that way. For the meantime, I can work around by just adding the punctuation to the template on Postmark, but I will play around with it tonight and update if I can make it work.

Thanks Johnny!

1 Like

Maybe try this? Determined to figure this out :grinning_face_with_smiling_eyes:

It worked! Okay so maybe I just didn’t know the correct way to format.

For anyone else that runs into this, “whatever text you are sending through”

Screen Shot 2021-12-03 at 5.13.17 PM

3 Likes

Yay! Glad we solved it :))

1 Like

I seem to be running into a similar issue when trying to send a email using the postmark Api, If I type plain text into the body I am able to send. Its only when I try using a email template we receive a ( HTTP 422 ) Im guessing this is a formatting issue ?? Any help would be appreciated !