Preview and validation
Every template command takes the template folder as an argument and defaults to the current folder, so inside the template you can leave it out.
Preview in the browser
trustisto template start ./my-popupServing ./my-popup on http://localhost:8080/index.html?id=test&locale=en&test=1
Press Ctrl+C to stop.Open the printed address in the browser and reload the page after a change. --port picks another port. If the template would not pass validation yet, start still serves it and lists the problems as a warning.
The page shows up filled in: our script, which every template loads (a mail too; it is removed when the mail is sent), replaces the {{param}} macros with the defaults from the manifest in the language of --locale (en unless set):
trustisto template start ./my-mail --locale plA parameter added to the address overrides its default, for example &headerTitle=Hello. The query parameters are described in Testing.
Validate
trustisto template validate ./my-popuptemplate validate runs the same checks as the upload in the panel, so you find problems before deploying:
manifest.jsonexists, is valid JSON and matches the manifest schema,- the files the type needs are there:
index.htmlfor every type, plusmanifest.jsonandthumbnail.pngfor a popup or a topbar, index.htmlof a popup or a topbar loads the Trustisto template script,index.htmlof a mail has the{{unsubscribeUrl}}and{{seeInBrowserUrl}}macros (see Mail templates),- the package has at most 100 files and 10 MB.
Each problem is printed on its own line, starting with the file it is in:
manifest.json: params.footer.type must be equal to one of the allowed values
index.html: no {{unsubscribeUrl}} macro, the upload will reject itThe command exits with code 1 when something is wrong, so it can stop a CI pipeline. Deploying runs the same checks first and does not upload an invalid template.