# MailTemplate

The MailTemplate type of the TypeScript SDK, which templates.create and templates.update take or answer.

```ts
type MailTemplate = {
  createdAt: number
  defaultLang: string
  from: string | null
  languages: string[]
  name: string
  replyTo: string | null
  slug: string
  updatedAt: number
  variables: Record<string, MailTemplateVariablesValue>
  version: number
}
```

## Fields

| Field | Type | Description |
| --- | --- | --- |
| `createdAt` | `number` |  |
| `defaultLang` | `string` |  |
| `from` | `string` \| `null` | The From address; always set on a template this API created |
| `languages` | `string[]` | The languages this template has copy for |
| `name` | `string` |  |
| `replyTo` | `string` \| `null` |  |
| `slug` | `string` |  |
| `updatedAt` | `number` |  |
| `variables` | `Record<string, MailTemplateVariablesValue>` |  |
| `version` | `number` | Bumped by every write that changes what a send would produce |

## Used by

| Method | What it does |
| --- | --- |
| [`templates.create`](/docs/sdks/typescript/templates/create) | Create a mail template |
| [`templates.update`](/docs/sdks/typescript/templates/update) | Update a template's metadata |

## Used in

[`MailTemplateDetail`](/docs/sdks/typescript/types/mail-template-detail), [`MailTemplateList`](/docs/sdks/typescript/types/mail-template-list).
