Postmark API response using Rich Postmark Email

Postmark support is asking if I have access to the returned response from postmark when I send them an email. We are trying to troubleshoot the issue from my other post today.

not with the plugin.

You should setup api calls, but not that easy to send attachment with it :pensive:

1 Like

@RobertBerger

@ZeroqodeTeam any chance to handle errors in a near future ?

1 Like

Sending attachments isn’t horrible, but it’s not fun either :sweat_smile: here’s how I do it:

This is my JSON body in my call:

{
  "From" : "<From>",
  "To" : "<To>",
  "Subject" : "<Subject>",
  "Tag": "<Tag>",
  "MessageStream": "<Message Stream>",
  "HtmlBody" : <HtmlBody>,
  "Attachments": [
    {
      "Name": "<Attachment Name>",
      "Content": "<Attachment Content>",
      "ContentType": "<Attachment Type>"
    }
  ]
}

Under the attachment array, for Name that’s just the name of the file, for Content Postmark takes it in base64 form (see screenshot below for how I accomplished that), and ContentType is the file type for example PDF is application/pdf

Screenshot 2024-06-13 at 23.48.17
Note: the field you’re referencing should be a file type

2 Likes

so nice tips @johnny ! can you pls show how you send multiple attachments ?

Nice! Are you using Rich Postmark email plugin for this or the bubble API connector?

API Connector :blush:

1 Like

Of course! If I were to setup an API call for a list of attachments, my JSON body would look like the following:

{
  "From" : "<From>",
  "To" : "<To>",
  "Subject" : "<Subject>",
  "Tag": "<Tag>",
  "MessageStream": "<Message Stream>",
  "HtmlBody" : <HtmlBody>,
  "Attachments": [<Attachment Data>]
}

Then in my list of files, I would format as text with the following:

{
  "Name": "Dynamic Attachment Name",
  "Content": "Dynamic Content in base64 format",
  "ContentType": "Dynamic Content Type"
}

Make sure to have a diliminator as a , at the end of the }, but not for the last one in the list to have valid JSON

Just an FYI about Postmark Attachment Limits

Screenshot 2024-06-14 at 09.54.42

1 Like