Postmark Component
The Postmark component is used as a developer friendly email delivery service
Component key: postmark
Description
Postmark is a fast and reliable transactional email service that's trusted by thousands of developers for sending emails on time and to the inbox.
Use the Postmark component to send emails, manage sender signatures, and analyze email delivery and engagement in your Postmark account.
A Note on Postmark Message Streams Pagination
Postmark's Message Streams API supports pagination. This means that the API will return up to 50 streams for any query. If additional results are available, the API response includes a Meta
field that indicates the TotalCount
and Offset
.
{
"MessageStreams": [],
"TotalCount": 100,
"Offset": 0
}
The Offset
can be used in a subsequent query to fetch additional results.
See Postmark's Docs for information about Postmark's paginated API, and this quickstart for information on looping over a paginated API in Prismatic.
Connections
Postmark Token Authentication
Access Tokens are necessary for interacting with the Postmark API. Access tokens are unique to each server you create in Postmark.
To generate an Access Token, you should log in to Postmark and navigate to your server page. Within the server settings, you can find your access tokens.
Postmark provides two types of access tokens:
-
Server Token: This token is used to send emails and perform other server-related actions in Postmark.
-
Account Token: This token is used to perform account-level actions, such as creating and managing servers.
For your integration, you will need both the Server Token and the Account Token.
For more information about access tokens, refer to the Postmark Docs.
Input | Notes |
---|---|
Account Token string / Required accountToken | |
Server Token string serverToken |
Triggers
Webhook
Receive and validate webhook requests from Postmark for webhooks you configure. | key: postmarkWebhook
Actions
Create Server
Create a new server | key: createServer
Input | Default | Notes | Example |
---|---|---|---|
Delivery Type string deliveryType | Live | Specifies the type of environment for your server. Possible options: Live, Sandbox. Defaults to Live if not specified. This cannot be changed after the server has been created. | Live |
Inbound Hook URL string inboundHookUrl | URL to POST to every time an inbound event occurs. | http://hooks.example.com/inbound | |
Connection connection / Required postmarkConnection | The connection to use | ||
Raw Email Enabled boolean rawEmailEnabled | When enabled, the raw email content will be included with inbound webhook payloads under the RawEmail key. | false | |
Server Color string serverColor | |||
Server Name string serverName | Filter by a specific server name. Note that this is a string search, so 'MyServer' will match 'MyServer', 'MyServer Production', and 'MyServer Test'. | Production01 | |
SMTP API Activated boolean smtpApiActivated | false | Specifies whether or not SMTP is enabled on this server. |
Create Webhook
Create a new webhook | key: createWebhook
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required postmarkConnection | The connection to use | ||
Triggers code triggers | A JSON object specifying the triggers for the webhook. Use the default structure as a guideline. | ||
Webhook URL string / Required webhookUrl | Your webhook URL. | http://www.example.com/webhook-test-tracking |
Delete Instanced Webhooks
Delete all webhooks that point to this instance | key: deleteInstancedWebhooks
Input | Notes |
---|---|
Connection connection / Required postmarkConnection | The connection to use |
Delete Server
Delete an existing server | key: deleteServer
Input | Notes |
---|---|
Connection connection / Required postmarkConnection | The connection to use |
Server ID string / Required serverId |
Delete Webhook
Delete a specific webhook | key: deleteWebhook
Input | Notes | Example |
---|---|---|
Connection connection / Required postmarkConnection | The connection to use | |
Webhook ID string / Required webhookId | The ID of the webhook to retrieve. | 1234567 |
Edit Server
Edit an existing server | key: editServers
Input | Default | Notes | Example |
---|---|---|---|
Enable SMTP API Error Hooks boolean enableSmtpApiErrorHooks | false | ||
Inbound Hook URL string inboundHookUrl | URL to POST to every time an inbound event occurs. | http://hooks.example.com/inbound | |
Connection connection / Required postmarkConnection | The connection to use | ||
Raw Email Enabled boolean rawEmailEnabled | When enabled, the raw email content will be included with inbound webhook payloads under the RawEmail key. | false | |
Server Color string serverColor | |||
Server ID string / Required serverId | |||
Server Name string serverName | Filter by a specific server name. Note that this is a string search, so 'MyServer' will match 'MyServer', 'MyServer Production', and 'MyServer Test'. | Production01 | |
SMTP API Activated boolean smtpApiActivated | false | Specifies whether or not SMTP is enabled on this server. |
Edit Server Using Server Token Account
Edit an existing server | key: editServer
Input | Notes | Example |
---|---|---|
Connection connection / Required postmarkConnection | The connection to use | |
Server Color string serverColor | ||
Server Name string serverName | Filter by a specific server name. Note that this is a string search, so 'MyServer' will match 'MyServer', 'MyServer Production', and 'MyServer Test'. | Production01 |
Edit Webhook
Edit an existing webhook | key: editWebhook
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required postmarkConnection | The connection to use | ||
Triggers code triggers | A JSON object specifying the triggers for the webhook. Use the default structure as a guideline. | ||
Webhook ID string / Required webhookId | The ID of the webhook to retrieve. | 1234567 | |
Webhook URL string / Required webhookUrl | Your webhook URL. | http://www.example.com/webhook-test-tracking |
Get Server
Get server information | key: getServer
Input | Notes |
---|---|
Connection connection / Required postmarkConnection | The connection to use |
Get Server
Get an existing server by ID | key: getServers
Input | Notes |
---|---|
Connection connection / Required postmarkConnection | The connection to use |
Server ID string / Required serverId |
Get Webhook
Retrieve a specific webhook | key: getWebhook
Input | Notes | Example |
---|---|---|
Connection connection / Required postmarkConnection | The connection to use | |
Webhook ID string / Required webhookId | The ID of the webhook to retrieve. | 1234567 |
List Servers
Get a list of all servers associated with the account | key: listServers
Input | Notes | Example |
---|---|---|
Count string / Required count | Number of servers to return per request | |
Offset string / Required offset | Number of servers to skip | |
Connection connection / Required postmarkConnection | The connection to use | |
Server Name string serverName | Filter by a specific server name. Note that this is a string search, so 'MyServer' will match 'MyServer', 'MyServer Production', and 'MyServer Test'. | Production01 |
List Webhooks
List all webhooks for a server | key: listWebhooks
Input | Default | Notes |
---|---|---|
Connection connection / Required postmarkConnection | The connection to use | |
Show Only Instance Webhooks boolean / Required showOnlyInstanceWebhooks | Show only webhooks that point to this instance. |
Raw Request
Send raw HTTP request to Postmark | key: rawRequest
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | The connection to use | ||
Data string data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} | |
Debug Request boolean debugRequest | false | Enabling this flag will log out the current request. | |
File Data string Key Value List fileData | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] | |
File Data File Names string Key Value List fileDataFileNames | File names to apply to the file data inputs. Keys must match the file data keys above. | ||
Form Data string Key Value List formData | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] | |
Header string Key Value List headers | A list of headers to send with the request. | User-Agent: curl/7.64.1 | |
Max Retry Count string maxRetries | 0 | The maximum number of retries to attempt. | |
Method string / Required method | The HTTP method to use. | ||
Query Parameter string Key Value List queryParams | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | ||
Response Type string / Required responseType | json | The type of data you expect in the response. You can request json, text, or binary data. | |
Retry On All Errors boolean retryAllErrors | false | If true, retries on all erroneous responses regardless of type. | |
Retry Delay (ms) string retryDelayMS | 0 | The delay in milliseconds between retries. | |
Timeout string timeout | The maximum time that a client will await a response to its request | 2000 | |
URL string / Required url | Input the path only (/servers/9363760), The base URL is already included (https://api.postmarkapp.com). For example, to connect to https://api.postmarkapp.com/servers/9363760, only /servers/9363760 is entered in this field. | /servers/9363760 | |
Use Exponential Backoff boolean useExponentialBackoff | false | Specifies whether to use a pre-defined exponential backoff strategy for retries. |
Send Email
Send an email using Postmark | key: sendSingleEmail
Input | Default | Notes | Example |
---|---|---|---|
Attachments code attachments | List of attachments | ||
Bcc string bccAddress | Provide a string value for any blind carbon copied email address(es). Can pass multiple as comma separated. Maximum of 50 recipients per message | blind-copied@example.com | |
Cc string ccAddress | Provide a string value for any carbon copied email address(es). Can pass multiple as comma separated. Maximum of 50 recipients per message | copied@example.com | |
From Address string / Required fromAddress | Provide a string value for the sender email address. | sender@example.com | |
Headers code headers | List of custom headers to include. | ||
Html Body code htmlBody | Provide specified HTML email message | ||
Metadata code metadata | Custom metadata key/value pairs. | ||
Connection connection / Required postmarkConnection | The connection to use | ||
Reply To string replyTo | Reply To override email address. Defaults to the Reply To set in the sender signature. | reply@example.com | |
Subject string subject | Provide string value for the subject of the outgoing message | Test | |
Tag string tag | Provide a string to categorize outgoing message | Invitation | |
Text Body string textBody | Provide a string for the body of the outgoing message | Hello | |
To Address string / Required toAddress | Provide a string value for the recipient(s) email address. Can pass multiple as comma separated. Maximum of 50 recipients per message | receiver@example.com | |
Track Opens boolean trackOpens | Activate open tracking for this email. |
Send Email Batch
Send a batch of emails using Postmark | key: sendBatchEmail
Input | Default | Notes |
---|---|---|
Emails code / Required emails | Provide a JSON array of email objects. Each object should include the necessary email information. | |
Connection connection / Required postmarkConnection | The connection to use |
Send Email Batch With Template
Send a batch of emails using a Postmark template | key: sendBatchEmailWithTemplate
Input | Default | Notes | Example |
---|---|---|---|
Messages code / Required Messages | The list of templates to send. Please note that we accept up to 500 messages per API call. | ||
Connection connection / Required postmarkConnection | The connection to use |
Send Email With Template
Send an email with a Postmark template | key: sendEmailWithTemplate
Input | Default | Notes | Example |
---|---|---|---|
Attachments code attachments | List of attachments | ||
Bcc string bccAddress | Provide a string value for any blind carbon copied email address(es). Can pass multiple as comma separated. Maximum of 50 recipients per message | blind-copied@example.com | |
Cc string ccAddress | Provide a string value for any carbon copied email address(es). Can pass multiple as comma separated. Maximum of 50 recipients per message | copied@example.com | |
From Address string / Required fromAddress | Provide a string value for the sender email address. | sender@example.com | |
Headers code headers | List of custom headers to include. | ||
Html Body code htmlBody | Provide specified HTML email message | ||
Inline Css boolean inlineCss | By default, if the specified template contains an HTMLBody, we will apply the style blocks as inline attributes to the rendered HTML content. You may opt-out of this behavior by passing false for this request field. | ||
Metadata code metadata | Custom metadata key/value pairs. | ||
Connection connection / Required postmarkConnection | The connection to use | ||
Reply To string replyTo | Reply To override email address. Defaults to the Reply To set in the sender signature. | reply@example.com | |
Subject string subject | Provide string value for the subject of the outgoing message | Test | |
Tag string tag | Provide a string to categorize outgoing message | Invitation | |
Template Alias string templateAlias | The alias of a template to use when sending this message. Required if TemplateId is not specified. | Template4 | |
Template ID string templateId | ID of the template to use to send the email. | myTemplateId | |
Template Model code / Required templateModel | The template data to use with the email template | ||
Text Body string textBody | Provide a string for the body of the outgoing message | Hello | |
To Address string / Required toAddress | Provide a string value for the recipient(s) email address. Can pass multiple as comma separated. Maximum of 50 recipients per message | receiver@example.com | |
Track Opens boolean trackOpens | Activate open tracking for this email. |