Populate order items in a list for Postmark Template Plugin

Hi @lindsay_knowcode

Thanks for a great plugin. I’ve managed to get my welcome and password emails firing, however I can’t seem to get my receipt emails to fire. I know it is because my order items in my template are causing an issue.

I can’t use the built in receipts template model because I need to also show the quantity in the order items table. For that reason I’m using custom variables. I’ve created new one called order_items and I get the order items and format them as text in a JSON object. I’ve tried both with and without adding “order_items” to the JSON model for the templating syntax. The email never comes through, which means the formatting isn’t correct.

Thanks to bubble not giving ANY ability to debug stuff like this, I’m not entirely sure what the issue is.

Could you create an example of a list with JSON so I can get my formatting correctly?

Thanks.

Yeap I’ll make an example.

In the plug-in there is a returned value called “debug” and that shows you the raw request and response to Postmark. Really helps to see this to figure out what is going wrong.

If you could grab that debug info we might be able to also sort it out from that.

Please could you screen shot what you are doing just so I am 100% clear :slight_smile:

The error I’m getting is

{"ErrorCode":101,"Message":"You encountered an error that shouldn't have occurred. The Error ID is c2dd9901-46e9-4d95-9f49-823464abf20a."}

This is the JSON list I’m creating.

For this custom variable:

When I remove the order_items custom variable. The email sends successfully. So it is most definitely something I’m doing wrong with how I’m creating that list.

1 Like

I’ve added an example of how I send in lists of items for the Postmark Receipt template. In the app and you can see the workflows also
https://postmark-template.bubbleapps.io/version-test

Also, there is a Youtube video walking you through it. https://youtu.be/WhS6s4xQ0HI Basically, the whole point of this Plugin is to avoid having to do the JSON handing within Bubble workflows which is possible, just very easy to screw up. :slight_smile:

So though the example uses the Receipt template - the same technique applies to any template where you have a list of descriptions and amounts. The lists are both Bubble lists of Texts. In your case what I would probably do is join up course & seats to be one text and total as the second list of Texts eg

"Cooking (3 seats) " , "Cleaning (10 seats)"
"£30.00", "$60.00"

Hope that helps :slight_smile:

Hi @lindsay_knowcode

Thanks, I’ve tried to create a list of texts but I’m obviously doing something wrong. My coder brain is not working in bubble mode this morning.

1 Like

yes, some needs some Bubble fiddling to join some fields and reform into a list … I’ll have a go a bit later :slight_smile:

Thanks mate, everything else in the plugin is awesome.

And double thank you for having the debugging output. That alone has saved me hours of work.

I’ve made an example here (look down the page a bit) - Postmark Template Plugin of how to join fields and reform them into a list.

Basically the Bubble trick of “format as text” and then “split by delimiter”.

1 Like

It Works!

Thanks mate! Huge checkbox done today.

1 Like