Get an email template mapping
- Sandbox: available
- Staging: available
- Production: unknown
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
:namemust be one of the template names. An unknown one returns 400UNKNOWN_TEMPLATEwith the accepted names.languageanddomainchoose which mapping of the template. Both are matched exactly, and leaving one out asks for the mapping that has none.languageis one of Ovok's locale codes, such asen-USorde-DE; a bareenis read asen-US, and any other value returns 422.domainis a host name such asapp.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.
subjectandhtmlare set for SMTP only.
Example
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'bearerAuthorizationBearer <JWT>name*stringThe template name.
language?string"Cy-az-AZ""Cy-sr-SP""Cy-uz-UZ""Lt-az-AZ""Lt-sr-SP""Lt-uz-UZ""aa""ab""ae""af""af-ZA""ak""am""an""ar""ar-AE""ar-BH""ar-DZ""ar-EG""ar-IQ""ar-JO""ar-KW""ar-LB""ar-LY""ar-MA""ar-OM""ar-QA""ar-SA""ar-SY""ar-TN""ar-YE""as""av""ay""az""ba""be""be-BY""bg""bg-BG""bh""bi""bm""bn""bo""br""bs""ca""ca-ES""ce""ch""co""cr""cs""cs-CZ""cu""cv""cy""da""da-DK""de""de-AT""de-CH""de-DE""de-LI""de-LU""div-MV""dv""dz""ee""el""el-GR""en""en-AU""en-BZ""en-CA""en-CB""en-GB""en-IE""en-JM""en-NZ""en-PH""en-TT""en-US""en-ZA""en-ZW""eo""es""es-AR""es-BO""es-CL""es-CO""es-CR""es-DO""es-EC""es-ES""es-GT""es-HN""es-MX""es-NI""es-PA""es-PE""es-PR""es-PY""es-SV""es-UY""es-VE""et""et-EE""eu""eu-ES""fa""fa-IR""ff""fi""fi-FI""fj""fo""fo-FO""fr""fr-BE""fr-CA""fr-CH""fr-FR""fr-LU""fr-MC""fy""ga""gd""gl""gl-ES""gn""gu""gu-IN""gv""ha""he""he-IL""hi""hi-IN""ho""hr""hr-HR""ht""hu""hu-HU""hy""hy-AM""hz""ia""id""id-ID""ie""ig""ii""ik""io""is""is-IS""it""it-CH""it-IT""iu""ja""ja-JP""jv""ka""ka-GE""kg""ki""kj""kk""kk-KZ""kl""km""kn""kn-IN""ko""ko-KR""kr""ks""ku""kv""kw""ky""ky-KZ""la""lb""lg""li""ln""lo""lt""lt-LT""lu""lv""lv-LV""mg""mh""mi""mk""mk-MK""ml""mn""mn-MN""mr""mr-IN""ms""ms-BN""ms-MY""mt""my""na""nb""nb-NO""nd""ne""ng""nl""nl-BE""nl-NL""nn""nn-NO""no""nr""nv""ny""oc""oj""om""or""os""pa""pa-IN""pi""pl""pl-PL""ps""pt""pt-BR""pt-PT""qu""rm""rn""ro""ro-RO""ru""ru-RU""rw""sa""sa-IN""sc""sd""se""sg""si""sk""sk-SK""sl""sl-SI""sm""sn""so""sq""sq-AL""sr""ss""st""su""sv""sv-FI""sv-SE""sw""sw-KE""ta""ta-IN""te""te-IN""tg""th""th-TH""ti""tk""tl""tn""to""tr""tr-TR""ts""tt""tt-RU""tw""ty""ug""uk""uk-UA""ur""ur-PK""uz""ve""vi""vi-VN""vo""wa""wo""xh""yi""yo""za""zh""zh-CHS""zh-CHT""zh-CN""zh-HK""zh-MO""zh-SG""zh-TW""zu"domain?string^(?:\[[0-9a-f:.]+\]|[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?(?:\.[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?)*)$length <= 253The mapping, with its HTML when it is an SMTP one.
application/json- response
name*string"OVOK_ORGANIZATION_CODES""INVITE_TO_PROJECT""RESET_PASSWORD""VIDEO_CALL_APPOINTMENT_INVITE""VIDEO_CALL_APPOINTMENT_UPDATE""VIDEO_CALL_APPOINTMENT_CANCEL""ACCOUNT_DELETION""ACCOUNT_DELETION_IMMEDIATE""TRENDS_PDF_EXPORT""CUSTOMER_SUPPORT_EMAIL""PATIENT_WELCOME""CLINICIAN_SIGNUP_INVITE""PATIENT_RESET_PASSWORD""PATIENT_ACCOUNT_DELETION""PATIENT_ORGANIZATION_CODES""PATIENT_INVITE""PATIENT_ASSIGNMENT_REQUEST""PRACTITIONER_INVITED_BY_PATIENT""PRACTITIONER_PATIENT_SHARED""RELATED_PERSON_INVITED""RELATED_PERSON_RECORD_SHARED""PRACTITIONER_ALERT_DIGEST"provider*string"brevo""sendgrid""resend""smtp"templateId*stringlanguage*stringThe language context, or null for a mapping that applies to any language.
domain*stringThe domain context, or null for a mapping that applies to any domain.
subject*stringSMTP only: the subject of the stored template.
ready*booleanWhether the project's secrets hold what this provider needs to send: its credential, and EMAIL_FROM for SendGrid and SMTP.
html*stringSMTP only: the stored HTML body.
curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/email-templates/string'{ "name": "OVOK_ORGANIZATION_CODES", "provider": "brevo", "templateId": "string", "language": "string", "domain": "string", "subject": "string", "ready": true, "html": "string"}List the project's email template mappings GET
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 - `mappings` holds the project's **own** mappings. Mappings of the parent project and of the platform are not listed. - `unmapped` holds 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 `language` and for its `domain`. A `null` `language` or `domain` means 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. - `ready` is `false` when the project's secrets lack what the provider needs: its credential (`BREVO_API_KEY`, `SENDGRID_API_KEY`, `RESEND_API_KEY` or `SMTP_URL`), and `EMAIL_FROM` for 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 `html` is left out: `GET /v1/projects/me/email-templates/:name` returns it. ## Example ```bash curl -X GET 'https://api.sandbox.ovok.com/v1/projects/me/email-templates' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```
Remove an email template mapping DELETE
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' ```