Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

UI: Configure Notifications #708

Open
etschelp opened this issue Jan 27, 2022 · 0 comments
Open

UI: Configure Notifications #708

etschelp opened this issue Jan 27, 2022 · 0 comments

Comments

@etschelp
Copy link
Contributor

etschelp commented Jan 27, 2022

In the BPA we have two places where we need to send notifications:

  1. Send connection invitations by email
  2. Send notifications (email, sms, etc.) when something happens that requires user interaction when running in manual mode e.g. receiving a connection request, credential proposal, or presentation request.

The first action is triggered by the user e.g. when creating a connection invitation. The second action is triggered automatically. To fit both of those needs the backend splits the messaging configuration into three parts:

  1. Message Templates

This is the text that is send in the message. Currently this only plain text, and the backend will filter out any html tags, but if we need this we can easily activate it. The template supports placeholders, currently the backend knows {{event}}, {{time}}, but we probably need more like the user

Currently posting a template look like:

POST /api/messaging/template

{
  "subject": "This is the emails subject",
  "template": "Hello {{user}}, you have received a {{type}} event at {{time}}."
}
  1. User Information

This is the information to whom the message is sent. Posting this looks like:

POST /api/messaging/user-info

{
  "sendTo": "[email protected]",
  "label": "Optional - Some human readable tag like: Test User"
}
  1. Message Triggers

Triggers wire template, user info and event type together. The userInfoId is optional and there will be a fallback to a default message template if it is missing.

POST /api/messaging/trigger

{
  "trigger": "CREDENTIAL_PROPOSAL",
  "messageTemplateId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "userInfoId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Possible message triggers are returned from the /api/admin/config endpoint like

{
    "messageTrigger": ["CONNECTION_REQUEST", "CREDENTIAL_PROPOSAL", "PRESENTATION_REQUEST"]
}
  1. Manually triggered invitation messages

POST /api/messaging/send-invitation

{
  "templateId": "optional uuid of the template, if not set will use default message template",
  "invitationId": "mandatory invitiationId returned from the create invitation endpoint",
  "userInfoId": "optional uuid of the userInfo",
  "email": "optional can be any email entered by the user. either email or userInfoId need to be set"
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant