ActiveCampaign / postmark-cli

The official CLI tool for Postmark
https://postmarkapp.com
MIT License
79 stars 9 forks source link

1.5.8 #36

Closed derekrushforth closed 3 years ago

derekrushforth commented 3 years ago

Hey @ibalosh!

Can you QA these improvements when you get the chance? Here's a rundown of what's changing:

Render subject line syntax on previews +

When previewing a template, the subject lines are now compiled through our system so that you can see how they look with your test model. Something that previously looked like this:

Screen Shot 2020-12-09 at 1 26 27 PM

Now looks like this:

Screen Shot 2020-12-09 at 1 26 10 PM

Validation errors returned from our API will be visible via tooltip:

Screen Shot 2020-12-09 at 1 25 25 PM

Related #28


Smarter template pushing

postmark templates push currently pushes all of your templates up to Postmark regardless of whether or not they were modified. The new default behavior will now compare your local template's name, subject, HTML, and text version with the corresponding template in Postmark and only push if it has been modified. This will provide a more accurate representation when reviewing what actually changed.

If you run the push command and there are no changes, the console output will return:

There are no changes to push.

You can also force push all of your templates up to Postmark, regardless of whether or not they were modified using the --all or -a arg.

postmark templates push ~/your-templates --all

This arg now also tells you if the template was "Unmodified" in the review output.

Screen Shot 2020-12-10 at 2 21 26 PM

Related #14


The builds are failing in node 7 for some reason. I'll look into this. Let me know if you have any questions. Thanks!

ibalosh commented 3 years ago

yep, will check today hombre

ibalosh commented 3 years ago

Note: I think that you should also check "LayoutTemplate" when checking for name, subject, HTML, and text version for comparison

derekrushforth commented 3 years ago

@ibalosh Ah! Great suggestion. I will include that today.

ibalosh commented 3 years ago

hey @derekrushforth

thanks! other than that, looks good, tried comparison and preview of subject, both worked like charm

(for me too it did not work in node 7, got error when trying preview)

ibalosh commented 3 years ago

hey @derekrushforth also, this is more of a tuning if you would like to do and you probably know about it: if you click link in page which is not setup in meta.json to be a link, error will be thrown (maybe we could catch an error and just do nothing on the page?) This happens when using default templates with default variable field values in json

video

derekrushforth commented 3 years ago

@ibalosh Good catch. Layout templates are now being checked and clicking on a link will no longer throw an error. For now, it's going to show this page since the template can't be found:

Screen Shot 2020-12-14 at 3 35 20 PM

Looks like our node 7 build failures are being caused by this. The clientOptions property is private and can only be accessed within the BaseClient class. I'm a little stumped on how to work around this so I will fix this separately. This functionality allows us to specify a staging URL when requesting data from our API.

ibalosh commented 3 years ago

Gotcha, all looks now ok, only if I use real URLs now (like https://www.google.com), it acts weird and wont open them. From what I see it seems it complains that it tries to open them in a frame or something. If it would be a new tab it would work

video

image

ibalosh commented 3 years ago

once I click open site in new window in Firefox it would work

derekrushforth commented 3 years ago

@ibalosh Just pushed an update that makes all links inside the template open up in a new window by default. This behavior is ideal since it doesn't interfere with the template preview iframes.

I did this by appending the <base target="_blank" /> tag to all of the template previews. The tag will not be included when pushing to PM.

ibalosh commented 3 years ago

looks great now, tx!