PostMark Email Services

City of Boston use PostMark to relay emails.

Code for this service/endpoint is contained in the module bos_email.

REST Endpoints

Requests an email token.

POST /rest/email_token/create

Provides an email session token which must be supplied as a field when the form is submitted to therest/email_session endpoints.

{
    "token_session": int
}

The session token is saved against the users session on the server.

Deletes an existing token.

POST /rest/token/remove

Invalidates a previously created email session token.

{
    "token_session": "removed"
}

or

{
    "token_session": "not found"
}

Send an email via PostMark

POST /rest/email_session/{server}

Headers

NameTypeDescription

authorization*

String

token {token}

Request Body

NameTypeDescription

email["token_session"]*

String

The session token.

email["to_address"]*

String

The recipient.

email["from_address"]*

String

The sender.

email["subject"]*

String

Subject for email.

email["message"]

String

Body for message (contactform)

email["useHtml"]

Int

Should mail be HTML format? 1 or 0

email["template_id"]

String

Use a POSTMARK template

email["cc"]

String

CC recipients for email.

email["bcc"]

String

BCC recipients for email.

email["{string}"]

String

Any other fields required by templates.

{
    'status': 'success',
    'response': 'Message sent'
}

or 

{
    'status': 'success',
    'response': 'Message queued'
}

[legacy] Send an email via PostMark (legacy)

POST /rest/email/{server}

Use email_session for additional security.

{
    'status': 'success',
    'response': 'Message sent'
}

or 

{
    'status': 'success',
    'response': 'Message queued'
}

[deprecated 2021] Alias for /rest/email/contactform

POST /emails

Last updated