---
url: /process-functions/security-getuseremail.md
description: Get the email address of a user from their user id.
---

# security.getUserEmail&#x20;

Get the email address of a user from their user id.

::: warning Deprecated
Use [`userSecurity.users.get(userId).getEmail()`](/process-functions/userSecurity-user#getemail) instead.
:::

```js
security.getUserEmail(userId)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `userId` | `number` | User ID |

## Returns

The user's email address, or `null` if the user was not found.

## Examples

```js
const email = security.getUserEmail(1234); // "jane.doe@example.com"
```
