---
title: Email stage
slug: email-stage
description: Learn how to effectively utilize the email stage for email verification with this comprehensive document. Discover how the system retries undelivered emails periodically and how to override the default behavior. Unlock the potential of custom email templa
docTags: 
createdAt: 2023-07-19T12:45:55.996Z
---

The email stage can be used for email verification, and the background worker will send an email using the specified connection details.&#x20;

If an email cannot be delivered, the delivery is automatically retried periodically. The default behavior is to send the email to the currently pending user, but this can be overridden by setting the `email` in the plan's context to another email address, see below:

```text
request.context["flow_plan"].context["email"] = "foo@bar.baz"
# Or get it from a prompt
# request.context["flow_plan"].context["email"] = request.context["prompt_data"]["email"]
# Or another user attribute
# request.context["flow_plan"].context["email"] = request.context["pending_user"].attributes.get("otherEmail")
return True
```

Custom email templates can also be used, to leverage your own design or layout.&#x20;

::::Tabs
:::Tab{title="docker-compose"}
By placing templates in the `custom-templates` folder and selecting the template when creating/editing an email stage. If the template is not visible, the worker logs should be checked.
:::

:::Tab{title="Kubernetes"}
Create a ConfigMap with your email templates:

\{% code overflow="wrap" %}

```yaml
apiVersion: v1 
kind: ConfigMap 
metadata: 
    name: authentik-templates
    namespace: authentik 
    data: 
        my-template.html: | 
        <tr>...
```

\{% endcode %}

Then, in the helm chart add this to your `values.yaml` file:

```yaml
volumes:
    - name: email-templates
      configMap:
          name: authentik-templates
volumeMounts:
    - name: email-templates
      mountPath: /templates
```
:::
::::

![](https://api.archbee.com/api/optimize/-uoBIPXCIMlUMvNPPrDxd/F-KGDAwpnyl6KavacrJDZ_create-eml-stage.jpeg)

