Tip

Found anything unclear or needy of further explanation? Do send us the feedback at docs@tattler.dev !

Command-line tools

Tattler installs three command-line utilities:

  • tattler_server – the notification server itself.

  • tattler_notify – fire a notification from the command line, e.g. from shell scripts or cron jobs.

  • tattler_livepreview – preview template edits live in your own mailbox while designing them.

tattler_server

Run the tattler notification server:

tattler_server

tattler_server takes no command-line arguments: it is configured entirely through environment variables, such as TATTLER_TEMPLATE_BASE and TATTLER_LISTEN_ADDRESS.

See Configuration for tattler_server for the full list of supported variables, and System administrators for deployment guidance.

tattler_notify

Send a notification through a running tattler server. For example:

tattler_notify -s 127.0.0.1:11503 -m production user@example.com mywebapp password_changed

Send notifications through a tattler server

usage: tattler_notify [-h] [-v VECTORS] [-s SERVER] [-m {staging,debug,production}] [-p {1,2,3,4,5}] [-j JSON_CONTEXT] [-a NAME=PATH-or-URL] recipient scope event_name [context ...]

Positional Arguments

recipient

ID of recipient to notify

scope

name of scope holding event

event_name

name of event to notify

context

Optional key=value variables to add to context. Repeat to set multiple variables. Default: no context.

Default: {}

Named Arguments

-v, --vectors

Optional comma-separated list of vectors to restrict the notification to. Default: deliver to all event-defined vectors.

-s, --server

Optional address:port of tattler server to request notification to. Default: 127.0.0.1:11503.

Default: 127.0.0.1:11503

-m, --mode

Possible choices: staging, debug, production

Optional mode for sending the notification (debug, staging, production). Default: debug.

Default: 'debug'

-p, --priority

Possible choices: 1, 2, 3, 4, 5

Optional priority for the notification. Default: None.

-j, --json-context

Optional path to a JSON file holding context data. Any command-line context vars gets merged on top of it.

-a, --attach

Attach a file to email notifications under NAME. NAME containing ‘@’ is treated as an inline image (cid), referenced from HTML as <img src=”cid:NAME”>. NAME without ‘@’ is the filename of a regular attachment. The value is either a local path (read and uploaded) or an http(s):// URL (fetched by the server). Repeat to attach multiple files.

Default: []

tattler_livepreview

Edit a notification template and receive the resulting notification in your mailbox each time you save – see Live previews for a walk-through. For example:

tattler_livepreview ~/mytemplates

Monitor event templates and email you the expanded notification whenever a template file changes, to preview edits live.

usage: tattler_livepreview [-h] template_dir

Positional Arguments

template_dir

Path to the templates directory, holding scopes and event templates within it.