Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
6 changes: 6 additions & 0 deletions aselo-webchat-react-app/configSrc/zw/staging.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"deploymentKey": "REPLACE_WITH_ZW_STAGING_CONVERSATIONS_SERVICE_SID",
"environment": "staging",
"aseloBackendUrl": "https://hrm-staging.tl.techmatters.org",
"definitionVersion": "zw-v1"
}
12 changes: 12 additions & 0 deletions aselo-webchat-react-app/configSrc/zw/translations/en-US.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"WelcomeMessage": "Childline Zimbabwe",
"MessageCanvasTrayContent": "",
"MessageInputDisabledReasonHold":
"Thank you very much for this information. We'll transfer you now. Please hold for a counsellor.",
"AutoFirstMessage": "Incoming webchat contact from",
"PreEngagementDescription":
"Thank you for contacting Childline Zimbabwe. To chat with a counsellor, please type your name and select the Start Chat button.",
"WhatIsYourName": "What is your name?",
"StartChat": "Start Chat!",
"MessagePhase-MessageBubble-OtherParticipantMessageSenderName": "Childline Zimbabwe Counsellor"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"submitLabel": "StartChat",
"fields": [
{
"type": "input",
"type": "input-text",
"name": "friendlyName",
"label": "WhatIsYourName",
"placeholder": "Guest",
"required": true
}
]
}
}
11 changes: 10 additions & 1 deletion twilio-iac/helplines/zw/staging.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ locals {
}

channels = {
chat : {
messaging_mode = "conversations"
channel_type = "chat"
contact_identity = ""
templatefile = "/app/twilio-iac/helplines/zw/templates/studio-flows/messaging-greeting-message-blocking-v2.tftpl"
channel_flow_vars = {
chat_greeting_message = "Thank you for contacting Childline Zimbabwe, a counsellor will be with you shortly. If this is an emergency or you wait longer than 30 min, we recommend you call us for free at 116. You can also contact us on WhatsApp at +263 732 116 116."
}
chatbot_unique_names = []
},
webchat : {
channel_type = "web"
contact_identity = ""
templatefile = "/app/twilio-iac/helplines/zw/templates/studio-flows/messaging-greeting-message-blocking.tftpl"
channel_flow_vars = {
chat_greeting_message = "Thank you for contacting Childline Zimbabwe, a counsellor will be with you shortly. If this is an emergency or you wait longer than 30 min, we recommend you call us for free at 116. You can also contact us on WhatsApp at +263 732 116 116."

}
chatbot_unique_names = []
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
${
jsonencode(
{
"description": flow_description,
"states": [
{
"name": "Trigger",
"type": "trigger",
"transitions": [
{
"event": "incomingMessage"
},
{
"event": "incomingCall"
},
{
"next": "getProfileFlagsForIdentifiers",
"event": "incomingConversationMessage"
},
{
"event": "incomingRequest"
},
{
"event": "incomingParent"
}
],
"properties": {
"offset": {
"x": -90,
"y": -90
}
}
},
{
"name": "attributes",
"type": "send-to-flex",
"transitions": [
{
"event": "callComplete"
},
{
"event": "failedToEnqueue"
},
{
"event": "callFailure"
}
],
"properties": {
"offset": {
"x": -50,
"y": 860
},
"workflow": workflow_sids["master"],
"channel": task_channel_sids["chat"],
"attributes":channel_attributes["default"]
}
},
{
"name": "send_welcome_message",
"type": "send-message",
"transitions": [
{
"next": "attributes",
"event": "sent"
},
{
"event": "failed"
}
],
"properties": {
"offset": {
"x": -50,
"y": 610
},
"service": "{{trigger.conversation.InstanceSid}}",
"channel": "{{trigger.conversation.ChannelSid}}",
"from": flow_vars["widget_from"],
"to": "{{contact.channel.address}}",
"body": channel_flow_vars["chat_greeting_message"]
}
},
{
"name": "getProfileFlagsForIdentifiers",
"type": "make-http-request",
"transitions": [
{
"next": "contact_routing",
"event": "success"
},
{
"event": "failed"
}
],
"properties": {
"offset": {
"x": 90,
"y": 80
},
"method": "POST",
"content_type": "application/json;charset=utf-8",
"body": "{\"trigger\": {{trigger | to_json}}}",
"url": "${get_profile_flags_for_identifier_base_url}/getProfileFlagsForIdentifier"
}
},
{
"name": "contact_routing",
"type": "split-based-on",
"transitions": [
{
"next": "send_welcome_message",
"event": "noMatch"
},
{
"next": "blocked",
"event": "match",
"conditions": [
{
"friendly_name": "If value equal_to blocked",
"arguments": [
"{{widgets.getProfileFlagsForIdentifiers.parsed}}"
],
"type": "contains",
"value": "blocked"
}
]
}
],
"properties": {
"input": "{{widgets.getProfileFlagsForIdentifiers.parsed}}",
"offset": {
"x": 190,
"y": 320
}
}
},
{
"name": "blocked",
"type": "send-message",
"transitions": [
{
"event": "sent"
},
{
"event": "failed"
}
],
"properties": {
"offset": {
"x": 550,
"y": 600
},
"service": "{{trigger.conversation.InstanceSid}}",
"channel": "{{trigger.conversation.ChannelSid}}",
"from": flow_vars["widget_from"],
"to": "{{contact.channel.address}}",
"body": flow_vars["chat_blocked_message"]
}
}
],
"initial_state": "Trigger",
"flags": {
"allow_concurrent_calls": true
}
}

)
}
Loading