The official CLI tool for Postmark
Full Changelog: https://github.com/ActiveCampaign/postmark-cli/compare/v1.6.18...v1.6.19
Full Changelog: https://github.com/ActiveCampaign/postmark-cli/compare/v1.6.17...v1.6.18
null
TextBody when pulling templates by @derekrushforth in https://github.com/ActiveCampaign/postmark-cli/pull/69
Full Changelog: https://github.com/ActiveCampaign/postmark-cli/compare/v1.6.15...v1.6.17
The templates push
command now only pushes local templates to Postmark if they were modified or newly added. Prior to v1.5.8
, all local templates were pushed regardless of whether they were modified or not. This made it tough to see what templates actually changed in the review output.
If you prefer to force push all templates, regardless of their state, include the --all
argument. The review output will also tell you whether a template was unmodified, modified, or added.
The subject line in the template preview tool now renders your mustachio syntax with the values in your test template model. Subject lines that previously looked like this:
Now look like this:
The template preview tool will also show validation errors if there was an issue compiling the subject line:
The preview tool now opens all external links in your templates in a new window. This prevents buggy behavior whenever selecting a link.
A few automated security vulnerability fixes were included with this release.
You can now test your templates using a custom model! Pulling your templates will store each template's model inside the TestRenderModel
key in the metadata JSON file:
{
"Name": "Receipt",
"Alias": "receipt",
"Subject": "Receipt for XYZ Widgets",
"TemplateType": "Standard",
"LayoutTemplate": "basic",
"TestRenderModel": {
"name": "name_Value",
"credit_card_brand": "credit_card_brand_Value",
"credit_card_last_four": "credit_card_last_four_Value",
"billing_url": "billing_url_Value",
"receipt_id": "receipt_id_Value",
"date": "date_Value",
"receipt_details": [
{
"description": "description_Value",
"amount": "amount_Value"
}
],
"total": "total_Value",
"support_url": "support_url_Value",
"action_url": "action_url_Value",
"expiration_date": "expiration_date_Value",
"product_name": "product_name_Value"
}
}
You can then enter your own test data and use the preview command to see how your templates look:
We've added a new command that spins up a local web server so that you can easily preview your compiled templates.
After pulling your templates, pass the templates folder to the templates preview
command:
postmark templates preview ~/templates-folder
You will also need to authenticate using your server token so that API requests can be made to Postmark's template validation endpoint. A development server will be available at https://localhost:3005
. By default, the server will start on port 3005
. You can specify your own port using the --port
argument.
We've added layout support to the templates pull
and templates push
commands.
templates pull
Running the pull
command now adds layouts to the _layouts
folder in the project root. Here's an example of the folder structure:
pm-templates
βββ _layouts
β βββ plain
β βββ content.html
β βββ content.txt
β βββ meta.json
βββ password-reset
β βββ content.html
β βββ content.txt
β βββ meta.json
βββ welcome
βββ content.html
βββ meta.json
The meta.json
format for templates and layouts also differ a bit. Be sure to check out the wiki for more details.
templates push
Pushing now displays which layouts are being pushed, as well as which layout is being used on a standard template:
Weβre super excited to announce that Postmark now has an official command-line interface π. Version 1.0.0 supports pushing and pulling templates, sending emails, and fetching server lists. This makes Postmark and your CI/CD pipeline go together like peas and carrots.
Check out our blog post for more details.