SparkPost / mandrill-sparkpost-templates

Translate Mandrill Handlebars templates into SparkPost templates
https://www.sparkpost.com/blog/mandrill-template-migration-tool-mst3k/
Other
6 stars 3 forks source link

Unless #22

Closed apitts closed 6 years ago

apitts commented 6 years ago

Could {{#unless x}} {{/unless}} not just be replaced with {{if not x}} {{end}}?

ewandennis commented 6 years ago

On the surface it looks that way, doesn't it? I suspect we didn't add that due to questions about truthy and falsey values in SparkPost and Mandrill's Handlebars respectively.

If you have some good test cases, they'd make a good basis for a pull request ;)

apitts commented 6 years ago

Thanks @ewandennis! Yeah, that makes sense. My variables are all just simple booleans. I only had two templates with unless so I ended up just deleting the unless lines before using the migration tool then adding them back in as {{if not x}}{{end}} afterwards. Seems to be working OK.

ewandennis commented 6 years ago

Good to hear @apitts. I'm glad you're up and running.