# inboxjot templates

Manage email templates.

## templates list

List templates.

```sh
inboxjot templates list [options]
```

| Option                | Description                                   |
| --------------------- | --------------------------------------------- |
| `--query <QUERY>`     | Show only templates whose name has this text. |
| `-n, --limit <LIMIT>` | Show at most this many rows. Default: `50`.   |
| `--all`               | Show every row, one page after another.       |
| `--after <CURSOR>`    | Show the rows after this cursor.              |
| `--before <CURSOR>`   | Show the rows before this cursor.             |

```sh
inboxjot templates list
```

## templates inspect

Show a template.

```sh
inboxjot templates inspect <TEMPLATE>
```

| Argument   | Description                                               |
| ---------- | --------------------------------------------------------- |
| `TEMPLATE` | Template ID, such as tpl_06d2mfk8r5cx3nd8vt1qa. Required. |

```sh
inboxjot templates inspect tpl_06d2mfk8r5cx3nd8vt1qa
```

## templates create

Create a template.

```sh
inboxjot templates create [options]
```

| Option                    | Description                                      |
| ------------------------- | ------------------------------------------------ |
| `--name <NAME>`           | Template name.                                   |
| `--subject <SUBJECT>`     | Subject line.                                    |
| `--from <FROM>`           | From address, such as "Acme <<hello@acme.com>>". |
| `--reply-to <EMAIL>`      | Reply-to address.                                |
| `--preheader <PREHEADER>` | Preview text that shows after the subject.       |
| `--html-file <PATH>`      | Read the HTML from this file, or - for stdin.    |

```sh
inboxjot templates create --name Welcome --subject "Welcome to Acme" --html-file welcome.html
```

## templates update

Change the draft of a template.

```sh
inboxjot templates update <TEMPLATE> [options]
```

| Argument   | Description                                               |
| ---------- | --------------------------------------------------------- |
| `TEMPLATE` | Template ID, such as tpl_06d2mfk8r5cx3nd8vt1qa. Required. |

| Option                    | Description                                      |
| ------------------------- | ------------------------------------------------ |
| `--name <NAME>`           | Template name.                                   |
| `--subject <SUBJECT>`     | Subject line.                                    |
| `--from <FROM>`           | From address, such as "Acme <<hello@acme.com>>". |
| `--reply-to <EMAIL>`      | Reply-to address.                                |
| `--preheader <PREHEADER>` | Preview text that shows after the subject.       |
| `--html-file <PATH>`      | Read the HTML from this file, or - for stdin.    |

```sh
inboxjot templates update tpl_06d2mfk8r5cx3nd8vt1qa --html-file welcome.html
```

## templates preview

Print the draft HTML of a template.

```sh
inboxjot templates preview <TEMPLATE> [options]
```

| Argument   | Description                                               |
| ---------- | --------------------------------------------------------- |
| `TEMPLATE` | Template ID, such as tpl_06d2mfk8r5cx3nd8vt1qa. Required. |

| Option   | Description                               |
| -------- | ----------------------------------------- |
| `--text` | Print the plain text instead of the HTML. |
| `--open` | Open the HTML in your browser.            |

```sh
inboxjot templates preview tpl_06d2mfk8r5cx3nd8vt1qa --open
inboxjot templates preview tpl_06d2mfk8r5cx3nd8vt1qa --text
```

## templates publish

Publish the draft so sends use it.

```sh
inboxjot templates publish <TEMPLATE>
```

| Argument   | Description                                               |
| ---------- | --------------------------------------------------------- |
| `TEMPLATE` | Template ID, such as tpl_06d2mfk8r5cx3nd8vt1qa. Required. |

```sh
inboxjot templates publish tpl_06d2mfk8r5cx3nd8vt1qa
```

## templates versions list

List the saved versions of a template.

```sh
inboxjot templates versions list <TEMPLATE> [options]
```

| Argument   | Description                                               |
| ---------- | --------------------------------------------------------- |
| `TEMPLATE` | Template ID, such as tpl_06d2mfk8r5cx3nd8vt1qa. Required. |

| Option                | Description                                 |
| --------------------- | ------------------------------------------- |
| `-n, --limit <LIMIT>` | Show at most this many rows. Default: `50`. |
| `--all`               | Show every row, one page after another.     |
| `--after <CURSOR>`    | Show the rows after this cursor.            |
| `--before <CURSOR>`   | Show the rows before this cursor.           |

```sh
inboxjot templates versions list tpl_06d2mfk8r5cx3nd8vt1qa
```

## templates versions restore

Copy a version into the draft of a template.

```sh
inboxjot templates versions restore <TEMPLATE> <VERSION>
```

| Argument   | Description                                               |
| ---------- | --------------------------------------------------------- |
| `TEMPLATE` | Template ID, such as tpl_06d2mfk8r5cx3nd8vt1qa. Required. |
| `VERSION`  | Version ID, such as ver_06d2mfk8r5cx3nd8vt1qb. Required.  |

```sh
inboxjot templates versions restore tpl_06d2mfk8r5cx3nd8vt1qa ver_06d2mfk8r5cx3nd8vt1qb
```

## templates delete

Delete a template.

```sh
inboxjot templates delete <TEMPLATE>
```

| Argument   | Description                                               |
| ---------- | --------------------------------------------------------- |
| `TEMPLATE` | Template ID, such as tpl_06d2mfk8r5cx3nd8vt1qa. Required. |

```sh
inboxjot templates delete tpl_06d2mfk8r5cx3nd8vt1qa
```
