# tools.ozone.communication.createTemplate

> Published by [ozone-lexicons.bsky.social](https://lexicon.garden/identity/did:plc:33dt5kftu3jq2h5h4jjlqezt)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.communication.createTemplate)
- [Documentation](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.communication.createTemplate/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:33dt5kftu3jq2h5h4jjlqezt/tools.ozone.communication.createTemplate/examples)

## Definitions

### `tools.ozone.communication.createTemplate`

**Type**: `procedure`

Administrative action to create a new, re-usable communication (email for now) template.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `lang` | `string` (language) | No | Message language. |
| `name` | `string` | Yes | Name of the template. |
| `subject` | `string` | Yes | Subject of the message, used in emails. |
| `createdBy` | `string` (did) | No | DID of the user who is creating the template. |
| `contentMarkdown` | `string` | Yes | Content of the template, markdown supported, can contain variable placeholders. |

#### Output

**Encoding**: `application/json`

#### Errors

- **DuplicateTemplateName**

## Raw Schema

```json
{
  "id": "tools.ozone.communication.createTemplate",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "subject",
            "contentMarkdown",
            "name"
          ],
          "properties": {
            "lang": {
              "type": "string",
              "format": "language",
              "description": "Message language."
            },
            "name": {
              "type": "string",
              "description": "Name of the template."
            },
            "subject": {
              "type": "string",
              "description": "Subject of the message, used in emails."
            },
            "createdBy": {
              "type": "string",
              "format": "did",
              "description": "DID of the user who is creating the template."
            },
            "contentMarkdown": {
              "type": "string",
              "description": "Content of the template, markdown supported, can contain variable placeholders."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "DuplicateTemplateName"
        }
      ],
      "output": {
        "schema": {
          "ref": "tools.ozone.communication.defs#templateView",
          "type": "ref"
        },
        "encoding": "application/json"
      },
      "description": "Administrative action to create a new, re-usable communication (email for now) template."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
