Releases: ActiveCampaign/postmark-cli
v1.6.19
What's Changed
- Bump follow-redirects from 1.15.2 to 1.15.4 by @dependabot in #83
- Bump axios and postmark by @dependabot in #84
- chore: npm update by @tomek-ac in #85
- chore: Updated socket.io by @tomek-ac in #86
Full Changelog: v1.6.18...v1.6.19
v1.6.18
What's Changed
- Fixed comparing empty strings with nulls and undefined by @tomek-ac in #77
- Tidied up template commands by @tomek-ac in #76
- Bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in #74
- Updated supported Node versions by @tomek-ac in #79
- Using latest inquirer by @tomek-ac in #78
- Upgraded consolidate package by @tomek-ac in #80
- Pushing layouts before templates by @tomek-ac in #81
Full Changelog: v1.6.17...v1.6.18
v1.6.17
What's Changed
- Prevent TypeError from
null
TextBody when pulling templates by @derekrushforth in #69 - Using latest postmark by @tomek-ac in #71
- Bump socket.io-parser from 3.4.2 to 3.4.3 by @dependabot in #72
Full Changelog: v1.6.15...v1.6.17
v1.6.15
What's Changed
- Bump nconf from 0.10.0 to 0.11.4 by @dependabot in #60
- Bump ejs from 2.6.2 to 3.1.7 by @dependabot in #61
1.5.8 - Template command improvements and more
Template push improvements
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.
Template preview subject line rendering
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:
Template preview external links
The preview tool now opens all external links in your templates in a new window. This prevents buggy behavior whenever selecting a link.
Security fixes
A few automated security vulnerability fixes were included with this release.
Template test model storage
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:
πΌ Template preview command
We've added a new command that spins up a local web server so that you can easily preview your compiled templates.
- Standard templates are compiled with their layout
- Mustachio syntax rendering
- HTML and text version previews
- Small and large screen previews
- Hot reloading - Your browser will automatically reload each time you change your template
Getting started
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.
π₯π±Toggle between large and small screen sizes
π₯Hot reloading
Template layouts support
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:
1.0.0 is here! π
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.