> For the complete documentation index, see [llms.txt](https://developers.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.didomi.io/integrations/emailing/templates/manage-your-templates.md).

# Manage your templates

{% hint style="info" %}
To create your own email template, you need to benefit from **Integrations V2** Premium feature. Please reach out to our Support team (<support@didomi.io>) to get more information.
{% endhint %}

## Create a template

To create a new email template, send a **POST** request on `/marketplace/emails` endpoint and specify following properties:

| Property              | Description                         |
| --------------------- | ----------------------------------- |
| `type_id`             | Email provider id (`didomi`)        |
| `email_type`          | Email template id                   |
| `properties.html`     | Email template (HTML)               |
| `properties.subject`  | Email subject                       |
| `properties.reply_to` | Email addresses set in the reply-to |

```json
POST https://api.didomi.io/marketplace/emails?organization_id=YOUR_ORGANIZATION_ID

{
    "type_id": "didomi",
    /**
    * Email types available are detailled above.
    * For instance, to verify user identity,
    * in context of a Privacy request collection 
    * you will be using `request-verify` email
    */    
    "email_type": "TEMPLATE_ID",
    "properties": {
        "html": "YOUR_HTML",
        "subject": "EMAIL_SUBJECT",
        "reply_to": ["EMAIL_ADDRESS"]
    }
}
```

{% hint style="info" %}
Important: take care when editing the `properties` property. This is a JSONB and, by design, you need to fill in every property already added every time you edit this object. If you have added your own HTML and now want to set a `reply_to`, you need to provide both `html` and `reply_to` in order not to erase your previous changes.
{% endhint %}

💡 Note: this section only refers to `didomi` providers. You can also use your own provider: the workflow will look the same, however further configuration will be required. To fetch provider configuration schemas, send a GET request on `/marketplace/emails/properties-schema`.

## List all templates

To list email templates, send a **GET** request on `/marketplace/emails` endpoint.

```json
GET https://api.didomi.io/marketplace/emails?organization_id=YOUR_ORGANIZATION_ID

[
    {
        "type_id": "didomi",
        "email_type": "TEMPLATE_ID",
        "properties": {
            "html": "YOUR_HTML",
            "subject": "EMAIL_SUBJECT",
            "reply_to": ["EMAIL_ADDRESS"]
        }
    }
]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.didomi.io/integrations/emailing/templates/manage-your-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
