Postmark API response using Rich Postmark Email

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