agentleFS
ActiveCampaignActiveCampaign/postmark-skills/postmark-templates/SKILL.md

postmark-templates

Skill46 starsChanged 55 days agoMITView on GitHub

Use when creating, managing, or sending with Postmark server-side email templates — Handlebars syntax, layout inheritance, template validation, and cross-server pushing.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use TemplateAlias over TemplateId — aliases survive re-creation and work across environments:

    line 79
  2. Distinctive:

    Test-render without sending — useful in CI/CD before deploying template changes:

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Email Templates with Postmark

Overview

Postmark templates are server-side email templates using Handlebars syntax. Templates are rendered on Postmark's servers — no client-side rendering library needed.

FeatureDescription
SyntaxHandlebars (Mustache-compatible)
RenderingServer-side — no React, no client library
TypesStandard templates and Layout templates
InheritanceStandard templates can inherit from a Layout
ValidationAPI endpoint to test-render templates before sending
Cross-serverPush templates between servers (staging → production)
Limit100 templates per server (contact support for more)

Quick Start

  1. Create a template via API or the Postmark dashboard
  2. Define variables using Handlebars syntax: {{variable_name}}
  3. Send with template using POST /email/withTemplate or POST /email/batchWithTemplates
  4. Pass data via TemplateModel — Postmark renders and sends

Template Syntax (Handlebars)

Hello {{name}},                            {{! variable }}
{{{html_content}}}                         {{! unescaped HTML }}
{{#if premium}}Premium member{{/if}}       {{! conditional }}
{{#each items}}{{this.name}}{{/each}}      {{! iteration }}
{{customer.address.city}}                  {{! nested object }}

See references/handlebars-syntax.md for the full syntax reference including conditionals, iteration with index, nested objects, and common mistakes.

Template Types

TypeTemplateTypeSendablePurpose
Standard"Standard"YesDefines subject, HTML, and text body
Layout"Layout"NoReusable wrapper injected via {{{@content}}}

Standard templates can reference a Layout via LayoutTemplate: "layout-alias". The Standard template's body replaces {{{@content}}} in the Layout at send time.

See references/layout-templates.md for layout creation, assignment, and examples.

API Endpoints

Template CRUD

EndpointMethodDescription
/templatesPOSTCreate a new template
/templatesGETList all templates (?count=100&offset=0&templateType=Standard)
/templates/{idOrAlias}GETGet a single template
/templates/{idOrAlias}PUTUpdate a template
/templates/{idOrAlias}DELETEDelete a template
/templates/validatePOSTValidate template rendering
/templates/pushPUTPush templates to another server

Sending with Templates

EndpointMethodDescription
/email/withTemplatePOSTSend single email with template
/email/batchWithTemplatesPOSTSend batch with templates (up to 500)

Send with Template

Always use TemplateAlias over TemplateId — aliases survive re-creation and work across environments:

const postmark = require('postmark');
const client = new postmark.ServerClient(process.env.POSTMARK_SERVER_TOKEN);

await client.sendEmailWithTemplate({
  From: 'hello@yourdomain.com',
  To: 'customer@example.com',
  TemplateAlias: 'welcome-email',
  TemplateModel: {
    name: 'Jane Doe',
    product_name: 'Acme App'
  },
  MessageStream: 'outbound'
});

Validate a Template

Test-render without sending — useful in CI/CD before deploying template changes:

const validation = await client.validateTemplate({
  Subject: 'Welcome {{name}}',
  HtmlBody: '<h1>Hello {{name}}</h1>',
  TextBody: 'Hello {{name}}',
  TestRenderModel: { name: 'Test User' }
});

console.log('Valid:', validation.AllContentIsValid);
console.log('Rendered:', validation.Subject.RenderedContent);

See references/template-api.md for full CRUD operations (create, list, update, delete), batch sending, validate, and push between servers.

Common Mistakes

MistakeFix
Using {{html}} for HTML contentUse triple braces {{{html}}} for unescaped HTML
Forgetting {{{@content}}} in LayoutLayout templates must include {{{@content}}} placeholder
Deleting a Layout with dependentsRemove layout association from Standard templates first
Using Template ID across environmentsUse TemplateAlias — it survives re-creation and works across servers
Not validating before deployUse /templates/validate to test-render before sending
Sending a Layout directlyLayouts are wrappers — you can only send Standard templates
Missing TemplateModel fieldsHandlebars renders missing variables as empty strings — validate your data
Exceeding 100 templatesContact Postmark support to increase the per-server limit

Notes

  • Templates use Handlebars (Mustache-compatible) syntax — no React or client-side rendering needed
  • Template aliases are strings; template IDs are integers — prefer aliases for portability
  • TemplateType is either Standard (sendable) or Layout (wrapper)
  • Layout inheritance: Standard template body replaces {{{@content}}} in the Layout
  • Push templates between servers using the Account Token (not Server Token)
  • Maximum 100 templates per server by default
  • Template validation (/templates/validate) lets you test-render without sending
  • Both TemplateId and TemplateAlias work for sending — use one, not both

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.