# `frontline email-templates`

Manage reusable, account-scoped email templates

```bash
frontline email-templates [options] [command]
```

## `frontline email-templates list`

List email templates (JSON by default; use --pretty/--table)

```bash
frontline email-templates list [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--search <text>` | Filter by name, subject or description |  |
| `--status <status>` | Filter by status: ACTIVE, ARCHIVED |  |
| `--include-archived` | Include archived templates |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates get`

Get an email template, including its current version and document

```bash
frontline email-templates get [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates create`

Create an email template from a JSON payload

```bash
frontline email-templates create [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--file <path>` | Template JSON payload file; use - for stdin |  |
| `--data <json>` | Inline JSON payload |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates update`

Replace an email template's content

```bash
frontline email-templates update [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--file <path>` | Template JSON payload file; use - for stdin |  |
| `--data <json>` | Inline JSON payload |  |
| `--expected-version <version>` | Version the update is based on |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates patch`

Apply focused operations to an email template

```bash
frontline email-templates patch [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--file <path>` | Patch JSON file; use - for stdin |  |
| `--data <json>` | Inline JSON patch |  |
| `--expected-version <version>` | Version the patch is based on |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates patch-preview`

Preview a patch without applying it

```bash
frontline email-templates patch-preview [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--file <path>` | Patch JSON file; use - for stdin |  |
| `--data <json>` | Inline JSON patch |  |
| `--expected-version <version>` | Fail if the template moved past this version |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates duplicate`

Duplicate an email template

```bash
frontline email-templates duplicate [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--name <name>` | Name for the copy |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates archive`

Archive or restore an email template

```bash
frontline email-templates archive [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--restore` | Restore an archived template instead of archiving it |  |
| `--expected-version <version>` | Version the change is based on |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates preview`

Render an email template, optionally against a Person

```bash
frontline email-templates preview [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--person-id <personRowId>` | People row ID (SoR) used to fill variables |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates revisions`

List an email template's revision history

```bash
frontline email-templates revisions [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--template-id <id>` | Email template ID |  |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |


## `frontline email-templates variables`

List the variables an email template may reference

```bash
frontline email-templates variables [options]
```

**Options**

| Flag | Description | Default |
|  --- | --- | --- |
| `--api-key <key>` | Override API key for this run (else FRONTLINE_API_KEY env, else stored profile key) |  |
| `--base-url <url>` | Advanced: override Public API base URL for this run |  |
| `--profile <name>` | Credentials profile: uses that profile's saved API key and Public API base URL (see `frontline auth profiles list`) |  |
| `--debug` | Show debug info on stderr (token is redacted) |  |
| `--pretty` | Pretty-print human-readable output (instead of default JSON) |  |
| `--table` | Render list results as a table (implies --pretty) |  |
| `--json` | Output raw JSON (default behavior — accepted as a no-op) |  |