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’ occurs.
Note you must have already subscribed to the event you want to attach the email notification to.
Note: If you are the LUSID domain owner, you are automatically assigned the built-in lusid-administrator role, which has all the permissions necessary to perform the operations in this article.
Using the Notifications REST API
Currently, you can create one notification per API call.
- Obtain an API access token.
- Call the Notifications CreateEmailNotification API for your LUSID domain, passing in your API access token and:
- The
scope
andcode
of the subscription to attach it to. - A
subject
. You can use properties of the subscribed event in mustache templates to make the text more meaningful. - A
plainTextBody
and ahtmlBody
. You can use properties of the subscribed event in mustache templates to make the text more meaningful. - 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 codePortfolioCreated
:
The response is as follows. Note you can use thecurl -X POST "https://<your-domain>.lusid.com/notifications/api/subscriptions/PortfolioEvents/PortfolioCreated/notifications/email" -H "Authorization: Bearer <your-API-access-token>" -H "Content-Type: application/json" -d '{ "description": "EmailNotification", "subject": "Portfolio created in {{PortfolioScope}}", "plainTextBody": "A {{PortfolioDisplayName}} portfolio was created with code {{PortfolioCode}} in {{PortfolioScope}} at {{PortfolioCreated}}.", "htmlBody": "<p>A {{PortfolioDisplayName}} portfolio was created with code {{PortfolioCode}} in {{PortfolioScope}} at {{PortfolioCreated}}.</p>", "emailAddressTo": [ "portfolio-managers@acme.org" ], "emailAddressCc": [], "emailAddressBcc": [] }'
id
of the notification (highlighted in red) to reference it again in subsequent API calls:{ "id": "f12edd9b-3609-4579-b492-19f2520ee0bf", "description": "EmailNotification", "deliveryChannel": "Email", "recipients": { "EmailAddressTo": [ "portfolio-managers@acme.org" ], "EmailAddressCc": [], "EmailAddressBcc": [] }, "content": { "Subject": "Portfolio created in {{PortfolioScope}}", "PlainTextBody": "A {{PortfolioDisplayName}} portfolio was created with code {{PortfolioCode}} in {{PortfolioScope}} at {{PortfolioCreated}}.", "HtmlBody": "<p>A {{PortfolioDisplayName}} portfolio was created with code {{PortfolioCode}} in {{PortfolioScope}} at {{PortfolioCreated}}.</p>" }, "status": { "result": "Unprocessed", "lastUpdated": "2022-07-08T10:20:29.1903787+00:00" }, "createdAt": "2022-07-08T10:20:29.1903787+00:00", "createdBy": "00u91lo2d7X42sdse2p7", "lastModifiedAt": "2022-07-08T10:20:29.1903787+00:00", "lastModifiedBy": "00u91lo2d7X42sdse2p7" }
- The
Using the LUSID web app
<Coming soon>