---
title: "How do I notify people via email when an event occurs?"
slug: "how-do-i-notify-people-via-email-when-an-event-occurs"
updated: 2025-04-16T16:06:39Z
published: 2025-04-16T16:06:39Z
canonical: "support.lusid.com/how-do-i-notify-people-via-email-when-an-event-occurs"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I notify people via email when an event occurs?

Providing you are a LUSID user with sufficient access control permissions, you can create an email notification to send to people when [an event you have subscribed to](/v1/docs/how-do-i-subscribe-to-an-event) occurs. For example, you could email all the portfolio managers when the LUSID `PortfolioCreated` event occurs.

## Using the LUSID web app

1. Sign in to the [LUSID web app](https://www.lusid.com/app) as a user with suitable permissions.
2. From the top left menu, select **Notifications Management > Subscriptions**.
3. Locate the subscription you wish to create a notification for, and click the **Create Notification** icon. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(741).png)
4. Select **Email** as the notification type. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(742).png)
5. Specify:
  - A **Display name** to uniquely identify the notification.
  - An **Email subject** and **Email body**.

> [!NOTE]
> **Note:** You can use the **Add template field** dropdown to insert runtime values from the event subscription as [mustache templates](/v1/docs/using-mustache-templates-to-enrich-notifications), making the text more meaningful. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(743).png)
  - The email addresses of the intended notification recipients. You can specify up to 10 direct recipients, 10 carbon copies, and 10 blind carbon copies in their respective fields.
6. Click **Create** to save the notification.

> [!NOTE]
> Note
> 
> You must ensure the notification’s subscription is enabled in order to receive notifications for the event. ![](https://cdn.document360.io/d575ad81-c0ed-4980-bbd1-d59ac5c3de82/Images/Documentation/image(744).png)

## Using the Notification REST API

Currently, you can create one notification per API call. Note you must have already [subscribed to the event](/v1/docs/how-do-i-subscribe-to-an-event) you want to attach the email notification to.

1. [Obtain an API access token](/v1/docs/how-do-i-obtain-and-use-a-short-lived-api-access-token-from-okta).
2. Call the [CreateNotification](https://www.lusid.com/docs/api/notification/endpoints/notifications/CreateNotification/) API, passing in your API access token and:

For example, to attach an email notification to a subscription with the scope `PortfolioEvents` and code `PortfolioCreatedEvent`:

```json
curl -X POST "https://<your-domain>.lusid.com/notification/api/subscriptions/PortfolioEvents/PortfolioCreatedEvent/notifications" 
    -H "Authorization: Bearer <your-API-access-token>" 
    -H "Content-Type: application/json" 
    -d '{
      "notificationId": "PortfolioCreatedNotification",
      "displayName": "EmailNotification",
      "notificationType": {
        "Type": "Email",
        "Subject": "Portfolio created in {{Body.portfolioScope}}",
        "PlainTextBody": "A portfolio was created with code {{Body.portfolioCode}} in {{Body.portfolioScope}} at {{Header.timestamp}}.",
        "HtmlBody": "<p>A portfolio was created with code {{Body.portfolioCode}} in {{Body.portfolioScope}} at {{Header.timestamp}}.</p>",
        "EmailAddressTo": [
          "portfolio-managers@acme.org"
        ],
        "EmailAddressCc": [],
        "EmailAddressBcc": []
      }
    }'
```

The response is as follows. Note you can use the `id` of the notification to reference it again in subsequent API calls:

```json
{
    "notificationId": "PortfolioCreatedNotification",
    "displayName": "EmailNotification",
    "notificationType": {
      "type": "Email",
      "subject": "Portfolio created in {{Body.portfolioScope}}",
      "plainTextBody": "A portfolio was created with code {{Body.portfolioCode}} in {{Body.portfolioScope}} at {{Header.timestamp}}.",
      "htmlBody": "<p>A portfolio was created with code {{Body.portfolioCode}} in {{Body.portfolioScope}} at {{Header.timestamp}}.</p>"
      "emailAddressTo": [
        "portfolio-managers@acme.org"
      ],
      "emailAddressCc": [],
      "emailAddressBcc": []
    },
    "createdAt": "2023-07-08T10:20:29.1903787+00:00",
    "userIdCreated": "00u91lo2d7X42sdse2p7",
    "modifiedAt": "2023-07-08T10:20:29.1903787+00:00",
    "userIdModified": "00u91lo2d7X42sdse2p7",
    "href": "https://<your-domain>.lusid.com/notifications/api/subscriptions/PortfolioEvents/PortfolioCreatedEvent/notifications/PortfolioCreatedNotification"
}
```
  - The `scope` and `code` of the subscription to attach it to.
  - A `displayName` and unique `notificationId`.
  - A `Type` of `Email`.
  - A `Subject`. You can use attributes of the subscribed event in [mustache templates](/v1/docs/using-mustache-templates-to-enrich-notifications) to make the text more meaningful.
  - A `PlainTextBody` and a `HtmlBody`. As above, you can use attributes of the subscribed event in mustache templates.
  - A comma-separated list of email addresses. You can specify up to 10 direct recipients, 10 carbon copies, and 10 blind carbon copies in their respective fields.

Each system event has a set of attributes that describe that event. You can create a subscription to a system event every time the event occurs, or filter on event attributes to subscribe only in a particular set of circumstances. You can then attach notifications to the subscription to trigger emails, SMS messages, webhooks and more.
