---
title: Email for forgotten username
description: To configure emails for forgotten username functionality, you can add the following code block to the selfservice-username.json file:
component: pingidm
version: 7.2
page_id: pingidm:self-service-reference:uss-email-forgotten
canonical_url: https://docs.pingidentity.com/pingidm/7.5/self-service-reference/uss-email-forgotten.html
llms_txt: https://docs.pingidentity.com/pingidm/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
superseded_by: https://docs.pingidentity.com/pingidm/7.5/self-service-reference/uss-email-forgotten.html
---

# Email for forgotten username

To configure emails for forgotten username functionality, you can add the following code block to the `selfservice-username.json` file:

```json
{
    "name" : "emailUsername",
    "emailServiceUrl" : "external/email",
    "emailServiceParameters" : {
        "waitForCompletion" : false
    },
    "from" : "info@example.com",
    "mimeType" : "text/html",
    "subjectTranslations" : {
        "en" : "Account Information - username"
    },
    "messageTranslations" : {
        "en" : "<h3>Username is:</h3><br />%username%"
    },
    "usernameToken" : "%username%"
},
```

As suggested by the code block, it includes default email messages in English (`en`), with a `usernameToken` that includes the actual username in the message.

As noted in [Username retrieval](username-retrieval.html), you can make these changes over the following endpoint URI: `/openidm/config/selfservice/username`

If desired, you can also configure forgotten username retrieval emails through the admin UI. Select Configure > Forgotten Username, and click the [icon: pencil-alt, set=fas]button. The Configure Email Username window displays.

When you use the admin UI to customize forgotten username retrieval emails, you can review the changes in the `selfservice-username.json` file.
