# Create email template in the current tenant

`POST /api/email-template`

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Request body: application/json (required)

Type: object

Schema: [CreateEmailTemplateDTO](https://sourcey-gauzy.pages.dev/api-reference/models/createemailtemplatedto/index.md)

- `name` (required)
  Type: string

- `languageCode` (required)
  Type: string
  
  enum: ["en","bg","he","ru","fr","es","zh","de","pt","it","nl","pl","ar"]

- `mjml` (optional)
  Type: string

- `hbs` (required)
  Type: string

- `organizationId` (optional)
  Type: string

Responses:

- 201: 

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X POST 'http://localhost:3000/api/email-template' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "name": "string",
  "languageCode": "en",
  "mjml": "string",
  "hbs": "string",
  "organizationId": "string"
}'
```

### JavaScript

```javascript
const body = `{
  "name": "string",
  "languageCode": "en",
  "mjml": "string",
  "hbs": "string",
  "organizationId": "string"
}`;

const response = await fetch('http://localhost:3000/api/email-template', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "name": "string",
  "languageCode": "en",
  "mjml": "string",
  "hbs": "string",
  "organizationId": "string"
}'''

response = requests.post(
    'http://localhost:3000/api/email-template',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
