MESSAGE CODES
MESSAGES CODES are used to define the content of communication messages sent by the system (emails, SMS...)
Property | Value | Comments |
---|---|---|
#CODE:ID_STANDARD_CODE | #MESSAGE |
|
#CODE:ID_CODE | e.g. "ACCOUNT.PASSWORD_RESET.EMAIL.SUBJECT" |
|
#CODE:ID_LANGUAGE | "ES"|"IT"|"EN" | Available languages.... |
#CODE:CODE_DESCRIPTION | Description of ID_CODE (e.g. "Account password reset") | Communication message #CODE:ID_CODE |
Customization of messages
TWIG Scripting
The CODE_DESCRIPTION of each message is a template that is processed to render a text which will finally be sent to a user via a specific communication channel (email, sms). The processing of the message us done using TWIG scripting.
There exists a set of predefined variables that are available to the TWIG engine to format the message. The values assigned to the variables depend on the type of message as explained in next sections.
Examples of messages using TWIG scripting
The following template can be used to send an SMS message to a user that wants to reset his password:
Template | Rendered text | Comments |
---|---|---|
In order to reset your password use this code: {{reset_token}} | In order to reset your password use this code: 988766 | We have used the |
{% if name %} | <p>Dear John Martin,</p> | This is a more complex example where apart of using variables |
Communication channels
Messages are sent by one or more communication channels (e.g. email, SMS, etc.), and each channel may have different requirements. For example, when sending an email it is necessary to indicate the 'subject' and the 'body' of the message, but when sending a SMS it is only necessary to indicate the body.
For this reason each MESSAGE CODES requires multiple definitions to fit the requirements of each channel type. The generic format of a MESSAGE CODE name is:
{CODE}.{CHANNEL}[.PART]
Where
CODE
: The name of the MESSAGE CODECHANNEL
: Communication channel used to send the notificationEMAIL
SMS
PUSH_NOTIFICATION
WEBALERT
PART
: Some communication channels may have more than one text that must be configured. For example, when sending an email, it is necessary to specify the text of the subject and the body of the email
The following table shows the possible combinations of {channel} and {part}:
{CHANNEL} | {PART} | Comments |
---|---|---|
| The content of the BODY of an email accepts HTML. | |
SMS | Must be plain text. | |
PUSH_NOTIFICATION |
| Must be plain text. |
WEBALERT |
| Accepts HTML. Web alerts are sent to those clients that have subscribed to the alert service (see alert_subscribe () API function) Introduced in API version 2.7.15 |
HIS |
| Accepts HTML. Messages sent to users that have been imported from one external HIS using the interoperability capabilities Introduced in API version 2.7.30 |
ACCOUNT MESSAGE CODES
Messages sent by the system related with a user's account
Predefined variables FOR TWIG scripting | ||
Variable name | Description | Used in |
---|---|---|
| Name of the person to whom the message is sent | ACCOUNT.SEND_CODE ACCOUNT.PASSWORD_RESET ACCOUNT.SEND_CODE |
| Code used to validate user accounts | ACCOUNT.SEND_CODE |
| name of the person sending the request | ASSOCIATE.INVITATION. |
| LC2 link to reset the password | ACCOUNT.PASSWORD_RESET |
| Token required by the platform to reset the password | ACCOUNT.PASSWORD_RESET |
| The URL value depends on the type notification | ACCOUNT.SEND_CODE ASSOCIATE.INVITATION. |
ID_CODE | CODE_DESCRIPTION (EN) | COMMENTS |
---|---|---|
ACCOUNT.PASSWORD_RESET | ||
*.EMAIL.SUBJECT | Account password reset | Message sent when a user requests a password reset for his ACCOUNT. API functions involved: |
*.EMAIL.BODY | {% if name %} | |
*.SMS | In order to reset your password use this code: {{ reset_token }} | |
ACCOUNT.SEND_CODE | ||
*.EMAIL.SUBJECT | Use the following code to validate your new account: {{ code }} | Message sent when a user creates a new ACCOUNT to indicate the validation code API functions involved: |
*.EMAIL.BODY | {% if name %} | |
*.SMS | Use the following code to validate your new account: {{ code }} |
EVENT MESSAGE CODES
EVENT MESSAGE CODES are used to send notifications related with the creation of EVENT OBJECT, or when its status changes.
Predefined variables FOR TWIG scripting | ||
Variable name | Description | Used in |
---|---|---|
| description of the EVENT type. In customized EVENTS it is the name of the EVENT TEMPLATE | All EVENT messages |
| hyperlink to the EVENT in LC2 | All EVENT messages |
| Text of the first message that is included in the EVENT | All EVENT messages |
| name of the person sending the request | All EVENT messages |
| name of the issuer of the request | All EVENT messages |
| Name of the PROGRAM. Used in EVENTS that are bound to a PROGRAM | All EVENT messages |
| name of the TEAM sending the request | All EVENT messages |
| name of the person to which the request is addressed | All EVENT messages |
| name of the TEAM to which the message is addressed | All EVENT messages |
| Used in EVENTS that are bound to a TASK. For example, an EVENT of type REPORT are usually bound to a TASK that contains a REPORT. The TASK to which the EVENT is referred is defined as a parameter in FORMULA EVENT_INSERT() | All EVENT messages. |
| The URL value depends on the type EVENT:
|
|
| A temporary password that can be used by a new User to log in the platform. This variable only has a value when the notification is sent to a user that never logged in the platform before, and allows to sign-up using the temporary password (which will be required to be changed after the first login) |
|
Predefined EVENT type MESSAGE CODES
There exist a list of predefined EVENT types that can be used discretionally (normally by means of calls to the API function event_insert () or the FORMULA EVENT_INSERT()). These EVENT types have a predefined message template.
The MESSAGE CODES for these messages have the following format:
EVENT.{EV_CODE}.{CHANNEL}[.PART]
Where EV_CODE
depends on the type of EVENT. The following table shows the relation between the predefined EVENT types and the corresponding EV_CODE
:
Event type | {EV_CODE} | Description ( value of the |
---|---|---|
EVENT:SOCIAL | SOCIAL | Social issue |
EVENT:CARE | CARE | Care issue |
EVENT:ADMIN | ADMIN | Administrative Issue |
EVENT:TECH | TECH | Technical Issue |
EVENT:ENROLL_REQ | ENROLL_REQ | Enrollment Request |
EVENT:OPINION_REQ | OPINION_REQ | Opinion Request |
EVENT:CALL | CALL | Call |
EVENT:REPORT | REPORT | Report |
EVENT:CASE_INVITATION | CASE_INVITATION | Invitation |
EVENT:NEW_CASE_INVITATION | NEW_CASE_INVITATION | Invitation |
ID_CODE | CODE_DESCRIPTION (EN) | COMMENTS |
---|---|---|
SOCIAL, CARE, ADMIN, TECH, ENROLL_REQ, OPINION_REQ, CALL | ||
EVENT.*.EMAIL.SUBJECT(1) | You have a pending {{ event_type }} notification. | API functions involved:
|
EVENT.*.EMAIL.BODY(1) | <p>An event has been assigned to you.</p> | |
EVENT.*.SMS(1) | You have a pending {{ event_type }} notification. | |
EVENT.*.PUSH_NOTIFICATION.SUBJECT(1) | You have a new message | |
EVENT.*.PUSH_NOTIFICATION.BODY(1) | {{opening_remarks}} | |
EVENT.*.WEBALERT.SUBJECT(1)(2) | New notification | |
EVENT.*.WEBALERT.BODY(1)(2) | {{opening_remarks}} | |
EVENT.*.HIS.BODY(1)(3) | You have a new message in the PHM: {{opening_remarks}} | |
EVENT.REPORT | ||
*.EMAIL.SUBJECT | You have a new report available | API functions involved:
|
*.EMAIL.BODY | <p>You have a new report available.</p><br/><p>{{ opening_remarks }}</p><p><a href="{{event_url}}">Click here to access the report</a></p> | |
*.SMS | You have a new report available | |
*.PUSH_NOTIFICATION.SUBJECT | You have a new report available | |
*.PUSH_NOTIFICATION.BODY | {{opening_remarks}} | |
*.WEBALERT.SUBJECT(2) | You have a new report available | |
*.WEBALERT.BODY(2) | {{opening_remarks}} | |
*.HIS.BODY(3) | A new report is available for you in the PHM. Open your “medical records” section form you PHM to find your new report. | |
CASE_INVITATION | ||
EVENT.CASE_INVITATION.EMAIL.SUBJECT | You have been invited to participate in {{program}} platform | API functions involved:
This message is sent when an invitation is sent to an existing CASE (one that already existed in the platform and can sign-in with his account) |
EVENT.CASE_INVITATION.EMAIL.BODY | <p>{{target}}, ha estat invitat participar a la plataforma {{program}}</p>{% if opening_remarks %}<p style="white-space:pre-wrap;">{{opening_remarks}}</p><p></p>{% endif %}<p><a href="{{url}}">Veure l'invitació</a></p> | |
EVENT.CASE_INVITATION.SMS | {% if target != "" %} {{target}}, you {% else %} You {% endif %}have been invited to participate in {{program}} platform. View the invitation: {{url}} | |
EVENT.CASE_INVITATION.WEBALERT.SUBJECT | Invitation for accessing {{program}} platform | |
EVENT.CASE_INVITATION.WEBALERT.BODY | You have been invited to participate in {{program}} platform. {% if opening_remarks %}{{opening_remarks}}{% endif %} | |
EVENT.CASE_INVITATION.AIMED.BODY(3) | You have been invited to participate to the {{program}} care plan in the PHM | |
NEW_CASE_INVITATION | ||
EVENT.NEW_CASE_INVITATION.EMAIL.SUBJECT | You have been invited to participate in {{program}} platform | API functions involved:
This message is sent when an invitation is sent to a new CASE (one that didn't exist in the platform and must sign-up) |
EVENT.NEW_CASE_INVITATION.EMAIL.BODY | <p>{{target}}, you have been invited to participate in {{program}} platform</p>{% if opening_remarks %}<p style="white-space:pre-wrap;">{{opening_remarks}}</p><p></p>{% endif %}<p><a href="{{url}}">View the invitation</a></p> | |
EVENT.NEW_CASE_INVITATION.SMS | {% if target != "" %} {{target}}, you {% else %} You {% endif %}have been invited to participate in {{program}} platform. View the invitation: {{url}} | |
EVENT.NEW_CASE_INVITATION.WEBALERT.SUBJECT | Invitation for accessing {{program}} platform | |
EVENT.NEW_CASE_INVITATION.WEBALERT.BODY | You have been invited to participate in {{program}} platform. {% if opening_remarks %}{{opening_remarks}}{% endif %} |
(1) Currently message types SOCIAL, CARE, ADMIN, TECH, ENROLL_REQ, OPINION_REQ, CALL have the same description
(2) Introduced in API version 2.7.15
(3) Messages for sending notifications using the messaging system provided by a HIS connection (see HIS INTEGRATION). Only for users that have been imported from an external HIS. Introduced in API version 2.7.30
Customized EVENT MESSAGE CODES
Sometimes is necessary to create our own customized EVENT TEMPLATES. A customized EVENT TEMPLATE is a TASK TEMPLATE added to a PROGRAM whose WORKPLAN has been assigned to the stage "EVENT".
To insert customized EVENTS in an ADMISSION it is necessary to invoke the FORMULA EVENT_INSERT() filling the parameter event_code
with the TASK_CODE defined in the EVENT TEMPLATE.
All customized EVENT MESSAGE CODES have the same pattern:
EVENT.NOTIFICATION.{CHANNEL}[.PART]
The description assigned to the event_type
TWIG variable is the title of the TASK TEMPLATE (instead of the hard-coded description of predefined EVENTS)
ID_CODE | CODE_DESCRIPTION (EN) | COMMENTS |
---|---|---|
EVENT.NOTIFICATION | ||
*.EMAIL.SUBJECT | You have a pending {{ event_type }} notification. | API functions involved:
|
*.EMAIL.BODY | <p>An event has been assigned to you.</p> | |
*.SMS | You have a pending {{ event_type }} notification. | |
*.PUSH_NOTIFICATION.SUBJECT | You have a pending {{ event_type }} notification. | |
*.PUSH_NOTIFICATION.BODY | {{opening_remarks}} | |
*.WEBALERT.SUBJECT(1) | New notification | |
*.WEBALERT.BODY(1) | <p>An event has been assigned to you.</p><br/><p style="white-space:pre-wrap;">{{ opening_remarks }}</p> | |
*.HIS.BODY(2) | You have a new message in the PHM: {{opening_remarks}} |
(1) Introduced in API version 2.7.15
(2) Messages for sending notifications using the messaging system provided by a HIS connection (see HIS INTEGRATION). Only for users that have been imported from an external HIS. Introduced in API version 2.7.30
Outgoing EVENT MESSAGE CODES
Normally an EVENT is assigned to a TEAM or registered USER of the platform. In these cases, the communication channels used to send notifications are obtained from the CONTACT OBJECT of the TEAM or USER.
Nevertheless, sometimes it is necessary to send a notification to USER that is not registered in the platform. In these case, it is possible to assign a specific communication channel (an email address, phone number..) and the EVENT is considered an "Outgoing EVENT".
The MESSAGE CODE used for generating the message sent in an Outgoing EVENT has the following format:
EVENT.{CHANNEL}[.PART]
ID_CODE | CODE_DESCRIPTION (EN) |
---|---|
EVENT.EMAIL.SUBJECT | {{ event_type }} |
EVENT.EMAIL.BODY | <p>{{ opening_remarks }}</p> |
EVENT.SMS | {{ opening_remarks }} |
EVENT.PUSH_NOTIFICATION.SUBJECT | {{ event_type }} |
EVENT.PUSH_NOTIFICATION.BODY | {{opening_remarks}} |
EVENT.WEBALERT.SUBJECT(1) | New notification |
EVENT.WEBALERT.BODY(1) | {{ opening_remarks }} |
EVENT.HIS.BODY(2) | {{ opening_remarks }} |
(1) Introduced in API version 2.7.15
(2) Messages for sending notifications using the messaging system provided by a HIS connection (see HIS INTEGRATION). Only for users that have been imported from an external HIS. Introduced in API version 2.7.30
System EVENT MESSAGE CODES
Under some circumstances the system generates automatically an EVENT. For example, when a new member is added to a TEAM, a new EVENT is generated to send an invitation to the member.
System Event type | {EVTYPE} | Description ( value of the |
---|---|---|
EVENT:TEAM_REQUEST | TEAM_REQUEST | Team Request |
EVENT:TEAM_INVITATION | TEAM_INVITATION | Team Invitation |
EVENT:PROFESSIONAL_INVITATION | PROFESSIONAL_INIVITATION | Professional Invitation |
EVENT:ASSOCIATE_INVITATION | ASSOCIATE_INVITATION | Invitation |
ID_CODE | CODE_DESCRIPTION (EN) | COMMENTS |
---|---|---|
TEAM_REQUEST | ||
*.SMS | Membership in team {{ target_team }} requested by {{ requester_team }} | Used when a TEAM sends a request to become member of a TEAM API functions involved:
|
*.EMAIL.SUBJECT | Membership in team {{ target_team }} requested by {{ requester_team }} | |
*.EMAIL.BODY | <p>{{ requester_team }} has sent a request to join the TEAM "{{ target_team }}" administered by you</p> <p>Please visit your Team Administration Dashboard to manage the request</p> <p>{{ opening_remarks }}</p> | |
TEAM_INVITATION | ||
*.SMS | {{target_team}} has been invited to join the team {{requester_team}} | Used when sending an invitation to a TEAM to join another TEAM API functions involved:
|
*.EMAIL.SUBJECT | {{target_team}} has been invited to join the team {{requester_team}} | |
*.EMAIL.BODY | <p>{{target_team}} has received an invitation to join the team {{requester_team}}.</p> <p>You are receiving this mail because you are administrator of team {{target_team}}<p> <p>Please visit your Team Administration Dashboard to manage the invitation</p><p>{{opening_remarks}}</p> | |
PROFESSIONAL_INVITATION | ||
*.SMS | You have been invited to join the team {{requester_team}} | Used when sending an invitation to a PROFESSIONAL to join a TEAM API functions involved:
|
*.EMAIL.SUBJECT | You have been invited to join the team {{requester_team}} | |
*.EMAIL.BODY | <p>You have received an invitation to join the team {{requester_team}}.</p><p><a href="{{url}}">Ver la invitación</a></p> | |
ASSOCIATE_INVITATION | ||
*.EMAIL.SUBJECT | {{ poster }} has sent a request to be cared by you | API functions involved:
This message is sent when an invitation is sent to an existing ASSOCIATE (one that already existed in the platform and can sign-in with his account) |
*.EMAIL.BODY | <p>{{ poster }} has sent a request to be cared by you</p> | |