Actions
New feature / Change #7567
closedTwilio / Whatsapp template management
Start date:
09/12/2024
Due date:
% Done:
0%
Estimated time:
48:00 h
Description
Since Twilio and Whatsapp update, it's not possible anymore to send custom body. Instead, templates needs to be used.
There the tasks:
- Create new admin page to manage Twilio Whatsapp templates.
- Creating a new template requires:
- Existing language selection.
- Sentense selection to send (
config/locales/<language>.json
, one of "patient invite", "guest invite", "scheduled patient invite", "scheduled guest invite", "first invite reminder", "second invite reminder", "first guest invite reminder", "second guest invite reminder", "notification for offline action text", and probably more. - replace variable like %(branding)s by {{1}} - see documentation
- replace variable link by button - see documentation
- Once create, have a button to send for approval, this will create the template over API and send for validation. Save the ID into MongoDB.
- Pull every two minutes the status of pending approval template.
- When approved, the template ID can be used.
For doctor interface:
- Make Whatsapp unavailable for the language selected until the templates are approved.
Documentations:
- Template management: https://www.twilio.com/docs/content/content-api-resources#create-templates
- Send message with template: https://www.twilio.com/docs/content/content-api-resources#send-a-message-with-preconfigured-content
Actions