Integrations
Email
Postmark

How to send email with Postmark

How to send transactional email notifications to Postmark with Knock.

Knock integrates with Postmark to send email notifications to your users. This page describes how to get started with Postmark in Knock, including necessary provider configurations and additional data you can pass through to Postmark.

Features

#
  • Attachments support
  • Delivery tracking
  • Bounce Support
  • Knock link and open tracking
  • Postmark link and open tracking
  • Per environment configuration
  • Sandbox mode

Getting started

#

You can create a new Postmark channel in the dashboard under the Channels and sources page in your account settings. From there, you'll need to configure the channel for each environment you have.

Channel configuration

#

Configure the following settings per environment. Navigate to Channels and sources in your dashboard account settings and select your Postmark channel. Under Environment configurations, click the environment you'd like to configure to expand its settings, then click "Save changes" when you're done. Expand Advanced for additional options, including overrides and conditions.

Fields marked with an * are required.

API keystring*

The API key for your Postmark server.

From email addressstring | liquid*

The default sender email address (can use Liquid tags).

Whether to receive message delivery status updates from Postmark via webhook.

Whether to enable sandbox mode for your Postmark channel.

Whether to enable Knock email-open tracking.

Whether to enable Knock link-click tracking.

CSS inliningboolean

Whether Knock will inline CSS styles in your emails onto their associated HTML elements before sending, to improve email client compatibility. Defaults to true.


Optional Postmark settings

Open tracking (provider)boolean

Whether to enable Postmark email-open tracking.

Link tracking (provider)boolean

Whether to enable Postmark link-click tracking.

When configured, these optional overrides will apply to all emails sent from this channel in the configured environment. Learn more about email channel overrides here.

From namestring | liquid

The default sender name (can use Liquid tags).

Tostring | liquid

The To email address that email notifications will be sent to (can use Liquid tags). This value will override the designated recipient's email address.

Ccstring | liquid

The CC email address that email notifications will be sent to (can use Liquid tags).

Bccstring | liquid

The BCC email address that email notifications will be sent to (can use Liquid tags).

Reply-tostring | liquid

The reply-to email address that will be included on email notifications (can use Liquid tags).

Payload overridesJSON (string) | liquid

Provide a JSON object to merge into the API payload that is sent to the downstream provider.

Set optional per-environment conditions for this channel. These conditions are evaluated each time a workflow run encounters a step that uses this channel in the configured environment. If the conditions are not met, the step will be skipped.

Additional data sent

#

Knock sends the following attributes along with your emails:

  • Metadata.sender: always set to knock.app
  • Metadata.knock_message_id: the ID of the message this email is associated with
  • Metadata.knock_recipient_id: the Knock ID of the recipient this email is being sent to
  • Tag: the key of the workflow this message was generated from

You can learn about the role of these Postmark attributes in the Postmark API documentation.

Recipient data requirements

#

In order to send an email notification you'll need a valid email property set on your recipient.

Delivery status webhooks

#

When enabled, Postmark will send delivery status updates directly to Knock via webhooks, allowing you to track the full lifecycle of your email messages in real-time.

Prerequisites

#

Before enabling delivery status webhooks, you need:

  1. A verified sender signature or domain in Postmark
  2. A Postmark channel configured in Knock (see the getting started section above)
  3. Access to your Postmark server webhook settings

Setting up delivery status webhooks

#
1

Enable delivery status webhooks in Knock

  1. Navigate to Channels and sources in your Knock dashboard
  2. Select your Postmark channel
  3. Under Environment configurations, click the environment you want to configure to expand its settings
  4. Turn on Incoming webhook
  5. Copy the Webhook URL - you'll need this in the next step
  6. Click "Save changes"
2

Configure webhooks in Postmark

In the Postmark dashboard, configure webhooks to send delivery events to Knock:

  1. Go to your Postmark server and select the server you're using with Knock
  2. Select the message stream you're sending with, and open the Webhooks tab
  3. Click "Add webhook" and paste the webhook URL from Knock
  4. Select the events to send to Knock:
    • Delivery - Tracks successful delivery
    • Bounce - Tracks bounce events
    • Spam complaint - Tracks spam complaints reported by recipients
  5. Postmark will automatically begin sending events to Knock

Supported delivery statuses

#

When delivery status webhooks are enabled for Postmark, Knock will update message statuses based on these Postmark webhook events:

Postmark Event TypeKnock StatusDescription
DeliverydeliveredThe email was successfully delivered to the recipient's mail server
BouncebouncedThe email bounced due to invalid recipient or domain

Complaint events

#

When a recipient marks an email as spam, Postmark sends a SpamComplaint webhook event to Knock. Knock records a message.complaint event on the message. A complaint does not change the message's delivery status, because the message was delivered before the recipient reported it.

You can see complaint events in the message timeline in the Knock dashboard, and subscribe to them with outbound webhooks. Postmark deactivates the recipient's address after a spam complaint, so later sends to that address bounce.

Troubleshooting

#

If delivery status updates aren't appearing in Knock:

  1. Check webhook configuration. Verify both the Delivery and Bounce webhooks are configured with the correct Knock webhook URL in your Postmark server settings.
  2. Verify sender signature. Ensure you're sending from a verified sender signature or domain in Postmark.
  3. Check Postmark activity. Review the Activity page in Postmark to ensure emails are being sent successfully.

Using overrides to customize notifications

#

We provide full support for overriding the payload of your email notifications. This enables you to customize the API request that Knock sends to Postmark on your behalf.

Targeting a specific MessageStream

#

Knock does not target a specific MessageStream when sending your transactional email notifications to Postmark. This means that Postmark defaults your notifications to the "outbound" transactional stream.

For marketing use cases such as newsletters or product updates sent to large recipient lists, and particularly when leveraging Knock's broadcasts feature, we recommend following Postmark's best practices for sending promotional messaging via a separate MessageStream.

1

Configure a broadcast MessageStream in Postmark

Configure a Broadcast-type message stream in your Postmark account. Read more about the MessageStream API here.

2

Set a payload override in Knock

Set a payload override in Knock with the ID of the MessageStream that you'd like to target. This can be done at either the channel configuration level or directly in the settings of your workflow's email channel step:

New chat