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 occurs. For example, you could email all the portfolio managers when the LUSID ‘portfolio created’ event occurs.
- Method 1: Using the Notification REST API
- Method 2: Using the LUSID web app
- Method 3: Using Luminesce
Using the Notification REST API
Currently, you can create one notification per API call. Note you must have already subscribed to the event you want to attach the email notification to.
- Obtain an API access token.
- Call the CreateNotification API for your LUSID domain, passing in your API access token and:
- The
scope
andcode
of the subscription to attach it to. - A
displayName
and uniquenotificationId
. - A
Type
ofEmail
. - A
Subject
. You can use attributes of the subscribed event in mustache templates to make the text more meaningful. - A
PlainTextBody
and aHtmlBody
. 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.
PortfolioEvents
and codePortfolioCreatedEvent
:
The response is as follows. Note you can use thecurl -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": [] } }'
id
of the notification (highlighted in red) to reference it again in subsequent API calls:{ "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
Using the LUSID web app
<Coming soon>