Hi Bubblers,
I have been able to initialize my first email template using Postmark and was wondering if there is anyway to make it work with a single API call for all Transactional Templates.
The Template Model field is an array of key value pairs that changes with each template and Postmark. I tried adding in a variable/key value pair marke that is not used in the specific template and marking it as optional and leaving it blank but it gives me an error.
I have also tried initializing the call with the TemplateModel array as a single value = {“key1”: “value1”, “key2”: “value2”}, but Postmark rejects this as well. {“ErrorCode”:403,“Message”:“Invalid request field(s): $.TemplateModel”}
Does anyone have any way to set up the call so that you specify the template ID and template variables separately. It just seems super inefficient to create a separate call for each template you build.
Thanks in advance for you help.
I think you are asking how to send multiple custom transactional emails in one call? There is a lot of information here -https://postmark-template.bubbleapps.io/version-test - extracted the relevant section …
When should I use Postmark Transaction and when should I use Postmark Batch emails?
Transactional is good when you have 1-50 recipients and you want them to receive identical emails. Or send 1 customised email.
Batch is good when you want to send 1-500 recipients individually customised emails. There are two actions to send batches in this plugin - one where the values you’d expect to be the same for all the emails in the batch are single values - and one where everything can be customised per email - including the template. (just for convenience)
Also read this Transactional vs. marketing email explained | Postmark
I know what you mean here, because each Template Model is going to be different in Postmark you will need to create a new JSON for each one.
I use a single API call like this, and then build the JSON in Bubble workflows, usually in backend WFs, and pass it as a parameter:

2 Likes
Thanks @gf_wolfer.!!!
I tried doing it exactly as you are suggesting but could not get it to work. Since then I have come to realize just what a pain in the ass Postmark for getting json perfect - knowing that you have succeeded doing it this gives me the confidence to invest the time to make another stab at this.
It also helps that someone introduced me to Requestbin last week and it is freaking awesome, for figuring out where the json issues are.
Assuming there aren’t any lists for any of your templates you can just dump all parameters in your api call (if it makes it easier for you to debug the JSON) and only send the relevant ones for each template…