Global

Type Definitions

ClientDefaults

The defaults used for the construction of new clients. You can pass options in client constructors to override these options.

Properties:
Name Type Argument Default Description
requestHost string <optional>
api.postmarkapp.com

The host name for whichever server we should use to access the Postmark API.

ssl boolean <optional>
true

Should ssl be used for accessing the API (http/https)?

requestFactory function <optional>

Given the set of options, produce a new function that will be responsible for creating and processing HTTP requests.

PostmarkCallback(error, response)

Standard Postmark Callback

Parameters:
Name Type Description
error PostmarkError

An error message and status code if the request fails due to invalid data. error will be null if the API request was successful.

response object

The parsed JSON object that is sent as the result of the requested operation.

PostmarkError

Postmark Error

Properties:
Name Type Description
status number

The HTTP status code returned from the API.

message string

The error message returned from the API.

code number

The API status code returned. Note, this is NOT the HTTP status code.

PostmarkMessage

Postmark Message

Properties:
Name Type Argument Description
To string

A comma-separate list of recipients.

From string

The email address of the sender, must be a registered and confirmed Sender Signature.

Cc string <optional>

A comma-separated list of 'Cc' recipients.

Bcc string <optional>

A comma-separated list of 'Bcc' recipients.

ReplyTo string <optional>

The email address that should be used in the reply. Defaults to the 'From' address.

Tag string <optional>

Tag to apply to this message when it is sent.

Subject string <optional>

The subject to be used in the message being sent.

HtmlBody string <optional>

The HTML part of the email being sent. Optional when TextBody is specified.

TextBody string <optional>

The text part of the email being sent. Optional when HTMLBody is specified.

TrackOpens boolean <optional>

Should a tracking image be included on HTML emails to track statistics?

TrackLinks string <optional>

Should a link tracking be enabled for this message? (Possible values: 'HtmlOnly', 'TextOnly', 'HtmlAndText', 'None', and null)

Headers Array.<PostmarkMessageHeader>

The headers to apply when sending this message.

Attachments Array.<PostmarkAttachment>

Any attachments that should be included when sending the email.

PostmarkMessageHeader

Postmark Message Header

Properties:
Name Type Description
Name string

The name of the MIME Header.

Value string

The content of the MIME Header.

PostmarkTemplateMessage

Postmark Template Message

Properties:
Name Type Argument Description
TemplateId number

The templateId to use when sending this message.

To string

A comma-separate list of recipients.

From string

The email address of the sender, must be a registered and confirmed Sender Signature.

TemplateModel object

The model that will be applied to the Template when the email is sent.

InlineCss boolean <optional>

Should CSS on the HTMLBody be inlined? (Defaults to true)

Cc string <optional>

A comma-separated list of 'Cc' recipients.

Bcc string <optional>

A comma-separated list of 'Bcc' recipients.

ReplyTo string <optional>

The email address that should be used in the reply. Defaults to the 'From' address.

Tag string <optional>

The tag to apply to this message when it is sent.

TrackOpens boolean <optional>

Should a tracking image be included on HTML emails to track statistics?

TrackLinks string <optional>

Should a link tracking be enabled for this message? (Possible values: 'HtmlOnly', 'TextOnly', 'HtmlAndText', 'None', and null)

Headers Array.<PostmarkMessageHeader> <optional>

The headers to apply when sending this message.

Attachments Array.<PostmarkAttachment> <optional>

Any attachments that should be included when sending the email.