🎙Check out our brand new podcast: Talking Email with Postmark

How do I use a template alias?

If you wish to reference a template by an alias instead of its Template ID, you can set an alias that you then use in your API call to send an email with the template. You can set a template's alias using Postmark's UI or Templates API.

Set an alias using Postmark's UI

  1. Open the template you want to set an alias for.
  2. While viewing the template, choose Add alias.
  3. Add the alias for your template to use for referencing when sending (i.e., welcome).

    Note: Be sure to update your integration codebase that sends using the alias, if you ever change an existing alias.

Set an alias using the Templates API

To set an alias, edit the template using a PUT call to https://api.postmarkapp.com/templates/{templateID} with the alias you want to set included in the body:

 "Name": "Template Name"

Once you have your alias set, you can now use it to send an email with that template. You will still send the request to send to the same endpoint but instead of including a "TemplateId" field for identifying the template, you will use your alias for the template in a "TemplateAlias" field, like this:

 "TemplateAlias": "my-alias", 
 "TemplateModel": { 
 "user_name": "John Smith",
 "company": { 
 "name": "ACME"
 "From": "sender@example.com",
 "To": "receiver@example.com" 
Last updated May 27th, 2019

Still need some help?

Our customer success team has your back!