FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...


v1.3.0 Public

Postmark App ColdFusion API

This is a ColdFusion Wrapper written to interact with the Postmark API for transactional emails.

cfmlbadges cfmlbadges cfmlbadges cfmlbadges cfmlbadges cfmlbadges


Developed by Matt Gifford (aka coldfumonkeh)

Share the love

Got a lot out of this package? Saved you time and money?

Share the love and visit Matt's wishlist:


This package requires ColdFusion 9+ or Lucee 4.5+

Please note that the tests require ColdFusion 10+ or Lucee 4.5+

You will need a valid Postmark account and an associated account token to interact with the API.


The API wrapper covers all of the methods available within the API. Here's a short sample of what can be achieved:

var oPostmark = new Postmark( accountToken='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' );

// List servers associated with the account
var servers = oPostmark.listServers();

// Get details on a specific server
var server = oPostmark.getServer( serverId='xxxxxxx' );

// Send an email with attachments
  From='[email protected]',
  To='[email protected]',
  subject='Your awesome email subject line here',
  TextBody='This is the email email.',
  HtmlBody='<p>This is the email body</p>',
    {name='Text File', srcfile='/attachments/test.txt'},
    {name='Image', srcfile='/attachments/something.png'}

// Send batch emails
  emailData = [
      From='[email protected]',
      To='[email protected]',
      subject='First Batch Email',
      TextBody='This is an email.',
        {name='Text File', srcfile='/attachments/test.txt'},
        {name='Image', srcfile='/attachments/something.png'}
      From='[email protected]',
      To='[email protected]',
      subject='Second Batch Email',
      TextBody='This is an email .'

// Validate a template
  servertoken = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
  Subject = "{{##company}}{{name}}{{/company}} {{subjectHeadline}}",
  HtmlBody = "{{##company}}{{address}}{{/company}}{{##each person}} {{name}} {{/each}}",
  TextBody = "{{##company}}{{phone}}{{/company}}{{##each person}} {{name}} {{/each}}",
  TestRenderModel: {
    "userName": "bobby joe"

// Send an email using a template
    serverToken = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
    templateId = 'xxxxxxx',
    TemplateModel = {
      'user_name' = 'John Smith',
      'company' = {
        'name' = 'ACME'
    from = '[email protected]',
    to = '[email protected]'

CommandBox Compatible


This CF wrapper can be installed as standalone or as a ColdBox Module. Either approach requires a simple CommandBox command:

box install postmark

Then follow either the standalone or module instructions below.


This wrapper will be installed into a directory called postmark and then can be instantiated via new postmark.Postmark() with the following constructor arguments:

accountToken	=	'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

ColdBox Module

This package also is a ColdBox module as well. The module can be configured by creating a postmark configuration structure in your application configuration file: config/Coldbox.cfc with the following settings:

postmark = {
  accountToken	=	'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

Then you can leverage the CFC via the injection DSL: [email protected]"

Dependencies (0)

Dev Dependencies (1)


$ box install postmark

No collaborators yet.
  • May 18 2017 02:38 PM
  • Jul 08 2020 03:37 AM
  • 1,045
  • 243
  • 130