From 3ac219762b6cdc83a16e9c9ec0ebe7baf2df2400 Mon Sep 17 00:00:00 2001 From: Dee Luo <79488570+dee-luo@users.noreply.github.com> Date: Thu, 26 Feb 2026 14:28:29 -0500 Subject: [PATCH] Update language transition logic in webchat template --- .../ca/templates/studio-flows/webchat.tftpl | 46 ++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/twilio-iac/helplines/ca/templates/studio-flows/webchat.tftpl b/twilio-iac/helplines/ca/templates/studio-flows/webchat.tftpl index ce384dd578..5f68441b9d 100644 --- a/twilio-iac/helplines/ca/templates/studio-flows/webchat.tftpl +++ b/twilio-iac/helplines/ca/templates/studio-flows/webchat.tftpl @@ -356,7 +356,7 @@ ${ "event": "noMatch" }, { - "next": "check_counsellors_fr_post_queue", + "next": "split_language_post_queue", "event": "match", "conditions": [ { @@ -1739,6 +1739,50 @@ ${ "to": "{{contact.channel.address}}", "body": "Bonjour. Merci de nous avoir contactés. De manière inattendue, nous ne sommes pas en mesure de répondre à ton clavardage en direct. Toutefois, nous aimerions te proposer quelques alternatives, afin de pouvoir t'offrir du soutien. Si tu souhaites parler à un·e intervenant·e, appelle le 1-800-668-6868. Si tu préfères texter avec un·e répondant·e en situation de crise, envoyez le mot « Parler » par texto au 686868 ou connecte-toi via notre site web : https://jeunessejecoute.ca/besoin-daide-maintenant-envoie-nous-un-texto. Notre service de clavardage en français sera de nouveau disponible demain à 19 h(HE). En cas d’urgence, compose le 911. Merci. Prends soin de toi." } + }, + { + "name": "split_language_post_queue", + "type": "split-based-on", + "transitions": [ + { + "event": "noMatch" + }, + { + "next": "engagement", + "event": "match", + "conditions": [ + { + "friendly_name": "If value contains en-CA", + "arguments": [ + "{{trigger.message.ChannelAttributes.pre_engagement_data.language}}" + ], + "type": "contains", + "value": "en-CA" + } + ] + }, + { + "next": "check_counsellors_fr_post_queue", + "event": "match", + "conditions": [ + { + "friendly_name": "If value contains fr-CA", + "arguments": [ + "{{trigger.message.ChannelAttributes.pre_engagement_data.language}}" + ], + "type": "contains", + "value": "fr-CA" + } + ] + } + ], + "properties": { + "input": "{{trigger.message.ChannelAttributes.pre_engagement_data.language}}", + "offset": { + "x": 2100, + "y": 1760 + } + } } ], "initial_state": "Trigger",