List the project's email template mappings
- Sandbox: available
- Staging: available
- Production: unknown
Lists the email template mappings of your current project: for each Ovok template name, which template of your email provider it sends, in which language and for which domain. It also lists the template names the project has no mapping for.
Auth: bearer token. The caller must be a Practitioner, a project admin, or hold the System Owner access policy. Scope: the caller's project (from the token).
Behaviour
mappingsholds the project's own mappings. Mappings of the parent project and of the platform are not listed.unmappedholds the template names the project has no mapping for, in any language or domain. It does not say that nothing is sent: a parent project's or the platform's mapping may still apply, and an unmapped patient template (PATIENT_RESET_PASSWORD,PATIENT_ACCOUNT_DELETION,PATIENT_ORGANIZATION_CODES,PATIENT_INVITE) is sent as its shared template when the mapping maps that one.- A mapping applies to a mail in its
languageand for itsdomain. Anulllanguageordomainmeans the mapping names none. Sending tries the most specific context first: domain and language, domain and the project's default language, domain alone, language alone, the default language, then no context. Within one level it takes the project's mapping, then its parent's, then the platform's, so a parent's or the platform's mapping at a more specific level is used before the project's own at a less specific one. readyisfalsewhen the project's secrets lack what the provider needs: its credential (BREVO_API_KEY,SENDGRID_API_KEY,RESEND_API_KEYorSMTP_URL), andEMAIL_FROMfor SendGrid and SMTP. It only checks that they are there, not that they work. A mapping that is not ready cannot send; sending moves on to the next mapping that applies.- One language and domain use one provider. When a project has several ConceptMaps for the same language and domain, only the most recently updated one is read, as sending does.
- Mappings are ordered as the template names are, then by language and domain. Their
htmlis left out:GET /v1/projects/me/email-templates/:namereturns it.
Example
curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/email-templates' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'bearerAuthorizationBearer <JWT>The project's own mappings, and the template names it has none for.
application/json- response
projectId*stringmappings*array<>unmapped*array<>Template names this project has no mapping for, in any language or domain.
curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/email-templates'{ "projectId": "string", "mappings": [ { "name": "OVOK_ORGANIZATION_CODES", "provider": "brevo", "templateId": "string", "language": "string", "domain": "string", "subject": "string", "ready": true } ], "unmapped": [ "OVOK_ORGANIZATION_CODES" ]}List email templates and their params GET
Lists every email template a project can map in its email ConceptMap, with the params each one receives. Use it when you write or review a template. **Auth:** bearer token. The caller must be a Practitioner, an admin or a super admin, or hold the "System Owner" access policy. **Scope:** none. The list is the same for every project. ## Behaviour - Each entry has the template `name`, the `audience` (`patient` or `practitioner`), the `params`, a full `example`, and the `syntax` each provider uses to reference a param. - `audience` tells you whose app the `baseUrl` param points at: the patient app or the practitioner dashboard. - Every listed param is always sent. A param marked `nullable` is `null` when there is no value. - A send whose params do not match its template is refused, so a template can rely on every param listed. - Resend accepts text and numbers only. A list param `x` reaches Resend as `xList`, with one item per line, and a null reaches it as an empty string. - Entries follow the order of the `TemplateNames` enum. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/email/templates' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Get an email template mapping GET
Returns one email template mapping of your current project, with its HTML when it is an SMTP one. **Auth:** bearer token. The caller must be a Practitioner, a project 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 asks for the mapping that has none. `language` is one of Ovok's locale codes, such as `en-US` or `de-DE`; a bare `en` is read as `en-US`, and any other value returns 422. `domain` is a host name such as `app.example.com`, lower-cased, without scheme or port. - Only the project's own mappings are found. A template that is mapped in the parent project or the platform, but not here, returns 404. - `subject` and `html` are set for SMTP only. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/email-templates/INVITE_TO_PROJECT?language=en-US' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```