# Troubleshooting

Canonical page: https://docs.ovok.com/email-templates/troubleshooting

When an email does not arrive, work down this list. Each step names the request that answers it.

## The email was not sent [#the-email-was-not-sent]

| Check | How | If it fails |
| --- | --- | --- |
| The template is mapped | `GET /v1/projects/me/email-templates` and look for the name in `mappings` and `unmapped`. A parent project's or the platform's mapping may still apply. | [Map it](/email-templates/map-templates#create-or-replace). |
| The mapping is `ready` | `ready` in the same response. | [Set up the provider](/email-templates/email-providers), with a sender address for SendGrid and SMTP. |
| The mapping is for the right language and domain | The `language` and `domain` of the mapping against the language and site of the user. | Map the context you need, or one with none. See [how Ovok picks a mapping](/email-templates#how-ovok-picks-a-mapping). |
| The provider has the template | Open it at your provider. | Fix the id. A wrong id is accepted if it has the right shape. |
| The message's links resolve | A link needs an app URL: [`PATIENT_APP_URL`](/settings-and-features/settings/patient-app-url) or [`PRACTITIONER_APP_URL`](/settings-and-features/settings/practitioner-app-url). | Set it, or invitations answer `409`. |

## The invitation was undone [#the-invitation-was-undone]

If an invitation's email cannot be sent, the invitation is undone. [An admin invite](/invitations/team-members) fails in the Console, and the invitation routes under `/v1/invites` still answer `202`. The cause is almost always a template that is not mapped, or one that is not `ready`. See [Invitations](/invitations#emails-and-the-links-in-them).

## A registration or sign-up sent nothing [#a-registration-or-sign-up-sent-nothing]

- A new patient gets a welcome email only when `PATIENT_WELCOME` is mapped. Nothing is sent otherwise.
- A work-email registration becomes a practitioner invitation only when `CLINICIAN_SIGNUP_INVITE` can be sent. If it cannot, the person is registered as a patient and you are not told. See [`CLINICIAN_INVITE_ON_BUSINESS_EMAIL`](/settings-and-features/settings/clinician-invite-on-business-email).
- A practitioner registration sends no email at all.

## The wrong template went out [#the-wrong-template-went-out]

| What you see | Why |
| --- | --- |
| A parent's or the platform's wording instead of yours | Their mapping is at a more specific level than yours, and Ovok tries the most specific level first. Add a mapping at that level in your project. |
| The practitioner wording in a patient email | A patient variant is not mapped, and it is sent as its shared template. See [the patient variants](/email-templates/template-catalogue#patient-variants). |
| The old template after you removed one | A less specific mapping now applies, or an older mapping for the same language and domain came back. |

## `PUT` was refused [#put-was-refused]

| Answer | Cause |
| --- | --- |
| `422` [`INVALID_TEMPLATE_ID`](/errors/invalid-template-id) | The id has the wrong shape for the provider. |
| `422` [`INVALID_TEMPLATE_CONTENT`](/errors/invalid-template-content) | SMTP content with a parameter the message does not have, an unclosed block, or a blank html. See [the parameters](/email-templates/template-catalogue#parameters). |
| `409` [`PROVIDER_MISMATCH`](/errors/provider-mismatch) | That language and domain use another provider. |
| `409` [`locked`](/errors/locked) | Another write is running. Retry. |

## Email from your automations [#email-from-your-automations]

Email sent by a Bot is a different thing: the [`email` feature](/settings-and-features/features/email) controls it, and these templates do not apply. [`MAILING_ENABLED`](/settings-and-features/settings/mailing-enabled) controls neither.

## Related [#related]

- [Email templates](/email-templates)
- [Map templates with the API](/email-templates/map-templates)
