-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30fd886
commit d19d9dc
Showing
6 changed files
with
621 additions
and
6 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
hrm-form-definitions/form-definitions/cl/v1/profileForms/FlagDurations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"flag": "blocked", | ||
"label": "Bloqueo Temporal (24 Horas)", | ||
"durationInHours": "24" | ||
}, | ||
{ | ||
"flag": "blocked", | ||
"label": "Bloqueo Largo Plazo (1 Año)", | ||
"durationInHours": "8760" | ||
} | ||
] |
4 changes: 2 additions & 2 deletions
4
hrm-form-definitions/form-definitions/cl/v1/profileForms/Sections.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
297 changes: 297 additions & 0 deletions
297
...-iac/helplines/templates/studio-flows/messaging-no-chatbot-operating-hours-blocking.tftpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,297 @@ | ||
${ | ||
jsonencode( | ||
{ | ||
"description": "Webchat Studio Flow", | ||
"states": [ | ||
{ | ||
"name": "Trigger", | ||
"type": "trigger", | ||
"transitions": [ | ||
{ | ||
"next": "getProfileFlagsForIdentifier", | ||
"event": "incomingMessage" | ||
}, | ||
{ | ||
"event": "incomingCall" | ||
}, | ||
{ | ||
"event": "incomingConversationMessage" | ||
}, | ||
{ | ||
"event": "incomingRequest" | ||
}, | ||
{ | ||
"event": "incomingParent" | ||
} | ||
], | ||
"properties": { | ||
"offset": { | ||
"x": 0, | ||
"y": -10 | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "check_operating_hours", | ||
"type": "run-function", | ||
"transitions": [ | ||
{ | ||
"next": "split_status", | ||
"event": "success" | ||
}, | ||
{ | ||
"next": "webhook_notify_error", | ||
"event": "fail" | ||
} | ||
], | ||
"properties": { | ||
"service_sid": serverless_service_sid, | ||
"environment_sid": serverless_environment_sid, | ||
"offset": { | ||
"x": 0, | ||
"y": 600 | ||
}, | ||
"function_sid": flow_vars["operating_hours_function_sid"] | ||
"parameters": [ | ||
{ | ||
"value": "webchat", | ||
"key": "channel" | ||
}, | ||
{ | ||
"value": "true", | ||
"key": "includeMessageTextInResponse" | ||
}, | ||
{ | ||
"value": task_language, | ||
"key": "language" | ||
} | ||
], | ||
"url": "${serverless_url}/operatingHours" | ||
} | ||
}, | ||
{ | ||
"name": "split_status", | ||
"type": "split-based-on", | ||
"transitions": [ | ||
{ | ||
"next": "webhook_notify_error", | ||
"event": "noMatch" | ||
}, | ||
{ | ||
"next": "send_welcome_message", | ||
"event": "match", | ||
"conditions": [ | ||
{ | ||
"friendly_name": "If value equal_to open", | ||
"arguments": [ | ||
"{{widgets.check_operating_hours.parsed.status}}" | ||
], | ||
"type": "equal_to", | ||
"value": "open" | ||
} | ||
] | ||
}, | ||
{ | ||
"next": "send_closed", | ||
"event": "match", | ||
"conditions": [ | ||
{ | ||
"friendly_name": "If value equal_to closed", | ||
"arguments": [ | ||
"{{widgets.check_operating_hours.parsed.status}}" | ||
], | ||
"type": "equal_to", | ||
"value": "closed" | ||
} | ||
] | ||
} | ||
], | ||
"properties": { | ||
"input": "{{widgets.check_operating_hours.parsed.status}}", | ||
"offset": { | ||
"x": 210, | ||
"y": 860 | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "webhook_notify_error", | ||
"type": "make-http-request", | ||
"transitions": [ | ||
{ | ||
"event": "success" | ||
}, | ||
{ | ||
"event": "failed" | ||
} | ||
], | ||
"properties": { | ||
"offset": { | ||
"x": 80, | ||
"y": 1410 | ||
}, | ||
"method": "POST", | ||
"content_type": "application/json;charset=utf-8", | ||
"body": "{ \"text\": \"Issue detected on ${short_helpline} ${short_environment} Flow SID: {{flow.flow_sid}} Execution SID: {{flow.sid}} \" }", | ||
"url": webhook_url_studio_errors | ||
} | ||
}, | ||
{ | ||
"name": "send_welcome_message", | ||
"type": "send-message", | ||
"transitions": [ | ||
{ | ||
"next": "attributes", | ||
"event": "sent" | ||
}, | ||
{ | ||
"next": "webhook_notify_error", | ||
"event": "failed" | ||
} | ||
], | ||
"properties": { | ||
"offset": { | ||
"x": 420, | ||
"y": 1110 | ||
}, | ||
"service": "{{trigger.message.InstanceSid}}", | ||
"channel": "{{trigger.message.ChannelSid}}", | ||
"from": channel_flow_vars["widget_from"], | ||
"to": "{{contact.channel.address}}", | ||
"body": channel_flow_vars["chat_greeting_message"] | ||
} | ||
}, | ||
{ | ||
"name": "send_closed", | ||
"type": "send-message", | ||
"transitions": [ | ||
{ | ||
"event": "sent" | ||
}, | ||
{ | ||
"next": "webhook_notify_error", | ||
"event": "failed" | ||
} | ||
], | ||
"properties": { | ||
"offset": { | ||
"x": 990, | ||
"y": 1150 | ||
}, | ||
"service": "{{trigger.message.InstanceSid}}", | ||
"channel": "{{trigger.message.ChannelSid}}", | ||
"from": "Linea Libre", | ||
"to": "{{contact.channel.address}}", | ||
"body": "{{widgets.check_operating_hours.parsed.message}}" | ||
} | ||
}, | ||
{ | ||
"name": "attributes", | ||
"type": "send-to-flex", | ||
"transitions": [ | ||
{ | ||
"event": "callComplete" | ||
}, | ||
{ | ||
"event": "failedToEnqueue" | ||
}, | ||
{ | ||
"event": "callFailure" | ||
} | ||
], | ||
"properties": { | ||
"offset": { | ||
"x": 580, | ||
"y": 1400 | ||
}, | ||
"workflow": workflow_sids["master"], | ||
"channel": task_channel_sids["chat"], | ||
"attributes": channel_attributes["default"] | ||
} | ||
}, | ||
{ | ||
"name": "getProfileFlagsForIdentifier", | ||
"type": "make-http-request", | ||
"transitions": [ | ||
{ | ||
"next": "contact_routing", | ||
"event": "success" | ||
}, | ||
{ | ||
"next": "check_operating_hours", | ||
"event": "failed" | ||
} | ||
], | ||
"properties": { | ||
"offset": { | ||
"x": -300, | ||
"y": 150 | ||
}, | ||
"method": "POST", | ||
"content_type": "application/json;charset=utf-8", | ||
"body": "{ \"trigger\": {{trigger | to_json}}}", | ||
"url": "${serverless_url}/getProfileFlagsForIdentifier" | ||
} | ||
}, | ||
{ | ||
"name": "send_blocked_message", | ||
"type": "send-message", | ||
"transitions": [ | ||
{ | ||
"event": "sent" | ||
}, | ||
{ | ||
"event": "failed" | ||
} | ||
], | ||
"properties": { | ||
"offset": { | ||
"x": -420, | ||
"y": 770 | ||
}, | ||
"service": "{{trigger.message.InstanceSid}}", | ||
"channel": "{{trigger.message.ChannelSid}}", | ||
"from": "Linea Libre", | ||
"to": "{{contact.channel.address}}", | ||
"body": channel_flow_vars["chat_blocked_message"] | ||
} | ||
}, | ||
{ | ||
"name": "contact_routing", | ||
"type": "split-based-on", | ||
"transitions": [ | ||
{ | ||
"next": "check_operating_hours", | ||
"event": "noMatch" | ||
}, | ||
{ | ||
"next": "send_blocked_message", | ||
"event": "match", | ||
"conditions": [ | ||
{ | ||
"friendly_name": "If value contains blocked", | ||
"arguments": [ | ||
"{{widgets.getProfileFlagsForIdentifier.parsed.flags}}" | ||
], | ||
"type": "contains", | ||
"value": "blocked" | ||
} | ||
] | ||
} | ||
], | ||
"properties": { | ||
"input": "{{widgets.getProfileFlagsForIdentifier.parsed.flags}}", | ||
"offset": { | ||
"x": -590, | ||
"y": 470 | ||
} | ||
} | ||
} | ||
], | ||
"initial_state": "Trigger", | ||
"flags": { | ||
"allow_concurrent_calls": true | ||
} | ||
} | ||
) | ||
} |
Oops, something went wrong.