# Remove an email template mapping

Canonical page: https://docs.ovok.com/api/email/remove-an-email-template-mapping

`DELETE /v1/projects/me/email-templates/{name}`

Removes one email template mapping of your current project.

**Auth:** bearer token of a project admin. The caller must also be a Practitioner, an admin or hold the System Owner access policy.
**Scope:** the caller's project (from the token).

## Behaviour

- `:name` must be one of the template names. An unknown one returns 400 `UNKNOWN_TEMPLATE` with the accepted names.
- `language` and `domain` choose which mapping of the template. Both are matched exactly, and leaving one out removes the mapping that has none. A malformed `language` or `domain` returns 422.
- Only the project's own mappings can be removed. A template that is not mapped there returns 404, even when the parent project or the platform maps it.
- After it is removed, sending uses the next mapping that applies, in the order `GET /v1/projects/me/email-templates` describes. That can be a parent project's or the platform's mapping, including one for a more specific language or domain than the one you removed. With none, the mail is not sent, except that a patient template (`PATIENT_RESET_PASSWORD`, `PATIENT_ACCOUNT_DELETION`, `PATIENT_ORGANIZATION_CODES`, `PATIENT_INVITE`) is sent as its shared template when the same mapping maps that one.
- When it was the last mapping of its language and domain, that ConceptMap is deleted with it. If the project has an older ConceptMap for the same language and domain, only the newest is read, so removing it brings the older one back.
- A 409 means another write to the project's mappings is running, or they changed while the server wrote. Read them again and retry.
- The answer is 204 with no body.

## Example

```bash
curl -X DELETE 'https://api.sandbox.ovok.com/v1/projects/me/email-templates/INVITE_TO_PROJECT?language=en-US' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
