Skip to main content

skrybe templates

The brand's email templates. A template holds an HTML body, an optional plain text body and a default sender, and can be the starting point for a campaign with campaigns create --template.

Template IDs are the plain integers the web app shows.

CommandDescription
templatesShow the templates
templates getOne template, or its HTML
templates createCreate a template
templates updateEdit a template
templates deleteDelete a template

templates​

skrybe templates
skrybe templates ls

Shows the templates: ID, name, From address and editor. ls and list are aliases for the bare command.

ID  NAME          FROM             EDITOR
7 Newsletter hello@acme.test dragdrop
9 Plain update - html

API: api/templates/get-templates.php

templates get​

skrybe templates get <template-id> [--content]

Shows one template's ID, name, sender, Reply-To and editor.

FlagDescription
--contentPrint the HTML body instead (the plain text body if it has no HTML). With --output json, add html_text and plain_text to the record
skrybe templates get 7 --content > newsletter.html

API: api/templates/get-template.php

templates create​

skrybe templates create <name> --html-text <html|file://path> [options]

Creates a template. Under table, its ID goes to stdout so a script can capture it; under json and text its record is printed.

FlagDescription
--html-text <html>HTML body, or file:// and a path to it. Required
--plain-text <text>Plain text body, or file:// and a path to it
--from-name <name>Default From name for campaigns made from it
--from-email <email>Default From address
--reply-to <email>Default Reply-To address
--editor <editor>Editor the web app opens it in: html (default) or dragdrop
TEMPLATE=$(skrybe templates create 'Newsletter' --html-text file://newsletter.html \
--from-name Acme --from-email hello@acme.test)

API: api/templates/create-template.php

templates update​

skrybe templates update <template-id> [options]

Edits a template. Only the fields you pass change; at least one is required. Prints the template afterwards.

FlagDescription
--name <name>New name
--html-text <html>HTML body, or file:// and a path to it
--plain-text <text>Plain text body, or file:// and a path to it
--from-name <name>Default From name
--from-email <email>Default From address
--reply-to <email>Default Reply-To address
--editor <editor>html or dragdrop
skrybe templates update 7 --html-text file://newsletter-v2.html

API: api/templates/update-template.php

templates delete​

skrybe templates delete <template-id> [--yes]
skrybe templates rm <template-id> [--yes]

Deletes a template. Campaigns already made from it are not affected. Asks first at a terminal; needs --yes from a script.

FlagDescription
-y, --yesDelete without asking. Required when stdin is not a terminal

Under --output json: {"outcome": "deleted", "template_id": 7}.

API: api/templates/delete-template.php