---
title: "Preview a branded email"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.nicer.travel/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview a branded email

Path: Nicer API › identity

`GET /identity/email-preview/{templateName}`

URL: `https://api.nicer.travel/identity/email-preview/{templateName}`

Renders one of the agency's traveler emails with its current brand and sample data: subject, sender, Reply-To, HTML and plain text. Agency admins only.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Path parameters

- `templateName` (`identity.emailPreview.get.path.templateName`; string, required)

## Header parameters

- `x-nicer-company` (`identity.emailPreview.get.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
  headers: { "x-nicer-company": process.env.NICER_COMPANY },
});

await nicer.identity.emailPreview.get({
  "templateName": "string"
});
```

### Nicer CLI

```bash
nicer identity email-preview get --template-name 'string' --company "$NICER_COMPANY"
```

### cURL

```bash
curl --request GET \
  --url 'https://api.nicer.travel/identity/email-preview/<templateName>' \
  --header 'Authorization: Bearer <token>' \
  --header 'x-nicer-company: string'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/identity/email-preview/<templateName>';
const options = {
  method: 'GET',
  headers: {'x-nicer-company': 'string', Authorization: 'Bearer <token>'}
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/identity/email-preview/<templateName>"

headers = {
    "x-nicer-company": "string",
    "Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "from": "string",
  "html": "string",
  "replyTo": "string",
  "subject": "string",
  "text": "string"
}
```

- `from` (`identity.emailPreview.get.response.200.from`; string, required)
- `html` (`identity.emailPreview.get.response.200.html`; string, required)
- `replyTo` (`identity.emailPreview.get.response.200.replyTo`; any of, required)
  - any of the following: `string`, `null`
- `subject` (`identity.emailPreview.get.response.200.subject`; string, required)
- `text` (`identity.emailPreview.get.response.200.text`; string, required)

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.emailPreview.get.response.400.errorCode`; string, required)
- `errorMessage` (`identity.emailPreview.get.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.emailPreview.get.response.401.errorCode`; string, required)
- `errorMessage` (`identity.emailPreview.get.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`identity.emailPreview.get.response.403.errorCode`; string, required)
- `errorMessage` (`identity.emailPreview.get.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/identity/identity.emailPreview.get/index.md
