Postmark API & Custom HTML Email

I’m trying to send custom HTML emails via the Postmark API.

  1. I am able to send a basic email using the API. But the call breaks when I add the HTML parameter. FYI - I’m already using the :formatted as JSON-safe. Does anyone have experience getting this to work?

  2. Assuming I can get #1 to work…how would I incorporate merge tags within the HTML? I have tried to use a few merge options within the HTML via plugins (like: {{Name}}), but to no avail.

Thanks in advance!

Can I see a screenshot? Typically, for the HTML API calls you would just apply all your content inside the HTML in general and have one big blob for that. Inside the body, you should be able to attach dynamic values.

This has an HTML builder, postmark calls, merge tags, and everything setup for you :blush:

I did have to setup postmark HTML using JS inside the plugin. It was iffy using the API builder.

Thanks for your help. Good news. I got the email to send via the Postmark API. When I was passing the HTML, extra quotation marks were being added to the HTML Body. Once the extra quotes removed, the email sent.

I’m still struggling with Issue #2. I’m unable to pass through variables/parameters (like Name) within the HTML. Within the HTML, I’ve tried {{Name}} and {{{Name}}}, but no luck.

Here’s how the API is set up, using hard-coded test/dummy values. In the below example, I am trying to incorporate the “Name” variable within the htmlBody.

1 Like

Closing the loop…

To dynamically insert variables within the HTML template, I needed to format the variable using < Name >, instead of {{Name}} or {{{Name}}}. This did the trick!