How do I copy Templates to another Server?
Postmark has two options to move a Template from one Server to another Server: Duplicating a single Template, and Pushing all Templates.
Duplicating a single Template
- Go to the Templates tab within your Postmark Server.
- Click the drop-down menu next to the template you wish to duplicate and select Duplicate.
- Enter the Template name and select the server you want to copy the Template to, then click the blue Duplicate button.
- After duplicating, there's the option to edit the copied Template or return to the original Template.
Pushing Templates
Pushing sends every Template and Layout from one Server to another Server.
For example — let’s say you’ve added a Layout and associated Templates to your staging server. With pushing, after testing the Templates, you’re able to push the Templates and Layouts to your production server.
Using Postmark's UI
- Open the server containing the Templates and/or Layouts you want to push to another server and head to the Templates page
- Click the Push to another server button.
- Select the destination Server you want to push the Template(s) and/or Layout(s) to.
- Choose Push now to complete the push of the Templates to the destination Server. Choose the Preview button if you want to preview the changes.
Using the Templates API
Templates can be copied from a source server to another server using the Templates API as well.
Use this option for programmatically keeping your templates in sync across multiple environments or giving your users a way to sync template changes from your own UI.
When pushing, each Template must have a unique alias. For example, it’s not possible to push a Layout Template with an alias of “welcome-email” to a server that has a Standard Template with an alias of “welcome-email”.
{
"SourceServerID": <source server id>,
"DestinationServerID": <destination server id>,
"PerformChanges": true
}
curl "https://api.postmarkapp.com/templates/push" \
-X PUT \
-H "Accept: application/json" \
-H "X-Postmark-Account-Token: <account API token>" \
-d "{"SourceServerID":<source server id>, "DestinationServerID":<destination server id>, "PerformChanges":true}”