From 3cc29c825136240c15d89458f64baed9265f2d20 Mon Sep 17 00:00:00 2001 From: janorivera Date: Tue, 16 Jul 2024 14:44:58 -0400 Subject: [PATCH] Conversations: Alejandro/conversations/fix lex flows (#2408) * update templates * BR * et * hu * mt * mw * nz * pk * zm * zm * BR v2 * Fixing flex flow aws parameter --- .../br/templates/studio-flows/messaging.tftpl | 16 ++++++++++++++++ .../messaging-chatbot-operating-hours.tftpl | 8 ++++++++ .../templates/studio-flows/messaging-lex.tftpl | 8 ++++++++ .../templates/studio-flows/messaging-lex.tftpl | 8 ++++++++ .../mw/templates/studio-flows/mw-lex.tftpl | 10 +++++++++- .../studio-flows/messaging-lex-priority.tftpl | 8 ++++++++ .../studio-flows/with-lex-chatbot.tftpl | 16 ++++++++++++++++ .../studio-flows/messaging-lex-v2-blocking.tftpl | 8 ++++++++ .../templates/studio-flows/messaging-lex.tftpl | 8 ++++++++ .../studio-flows/messaging-webchat.tftpl | 8 ++++++++ .../zm/templates/studio-flows/messaging.tftpl | 8 ++++++++ twilio-iac/terraform-modules/channels/v1/main.tf | 2 +- 12 files changed, 106 insertions(+), 2 deletions(-) diff --git a/twilio-iac/helplines/br/templates/studio-flows/messaging.tftpl b/twilio-iac/helplines/br/templates/studio-flows/messaging.tftpl index 86319d802d..398f977572 100644 --- a/twilio-iac/helplines/br/templates/studio-flows/messaging.tftpl +++ b/twilio-iac/helplines/br/templates/studio-flows/messaging.tftpl @@ -523,6 +523,14 @@ ${ { "value": "contactReasonMemory", "key": "memoryAttribute" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" @@ -579,6 +587,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/et/templates/studio-flows/messaging-chatbot-operating-hours.tftpl b/twilio-iac/helplines/et/templates/studio-flows/messaging-chatbot-operating-hours.tftpl index 0d3fca3f75..8e9adb6e70 100644 --- a/twilio-iac/helplines/et/templates/studio-flows/messaging-chatbot-operating-hours.tftpl +++ b/twilio-iac/helplines/et/templates/studio-flows/messaging-chatbot-operating-hours.tftpl @@ -326,6 +326,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/hu/templates/studio-flows/messaging-lex.tftpl b/twilio-iac/helplines/hu/templates/studio-flows/messaging-lex.tftpl index 20871e9b0f..01f8b99c3a 100644 --- a/twilio-iac/helplines/hu/templates/studio-flows/messaging-lex.tftpl +++ b/twilio-iac/helplines/hu/templates/studio-flows/messaging-lex.tftpl @@ -309,6 +309,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/mt/templates/studio-flows/messaging-lex.tftpl b/twilio-iac/helplines/mt/templates/studio-flows/messaging-lex.tftpl index 0b715fa831..c013018ec5 100644 --- a/twilio-iac/helplines/mt/templates/studio-flows/messaging-lex.tftpl +++ b/twilio-iac/helplines/mt/templates/studio-flows/messaging-lex.tftpl @@ -219,6 +219,14 @@ ${ { "value": "languageMemory", "key": "memoryAttribute" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/mw/templates/studio-flows/mw-lex.tftpl b/twilio-iac/helplines/mw/templates/studio-flows/mw-lex.tftpl index 1246757734..3284af5644 100644 --- a/twilio-iac/helplines/mw/templates/studio-flows/mw-lex.tftpl +++ b/twilio-iac/helplines/mw/templates/studio-flows/mw-lex.tftpl @@ -495,7 +495,15 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" - } + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" + } ], "url": "${serverless_url}/${flow_vars["capture_channel_with_bot_function_name"]}" } diff --git a/twilio-iac/helplines/nz/templates/studio-flows/messaging-lex-priority.tftpl b/twilio-iac/helplines/nz/templates/studio-flows/messaging-lex-priority.tftpl index 3157b1f286..3739accbb8 100644 --- a/twilio-iac/helplines/nz/templates/studio-flows/messaging-lex-priority.tftpl +++ b/twilio-iac/helplines/nz/templates/studio-flows/messaging-lex-priority.tftpl @@ -138,6 +138,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/ph/templates/studio-flows/with-lex-chatbot.tftpl b/twilio-iac/helplines/ph/templates/studio-flows/with-lex-chatbot.tftpl index 434789dea0..a6a0d61379 100644 --- a/twilio-iac/helplines/ph/templates/studio-flows/with-lex-chatbot.tftpl +++ b/twilio-iac/helplines/ph/templates/studio-flows/with-lex-chatbot.tftpl @@ -1306,6 +1306,14 @@ ${ { "value": "preSurveyCompleteEn", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" @@ -1424,6 +1432,14 @@ ${ { "value": "preSurveyCompleteFil", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2-blocking.tftpl b/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2-blocking.tftpl index 675621052c..8b84181334 100644 --- a/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2-blocking.tftpl +++ b/twilio-iac/helplines/templates/studio-flows/messaging-lex-v2-blocking.tftpl @@ -217,6 +217,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/templates/studio-flows/messaging-lex.tftpl b/twilio-iac/helplines/templates/studio-flows/messaging-lex.tftpl index cf4f7aebdf..f290490648 100644 --- a/twilio-iac/helplines/templates/studio-flows/messaging-lex.tftpl +++ b/twilio-iac/helplines/templates/studio-flows/messaging-lex.tftpl @@ -137,6 +137,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/${flow_vars["capture_channel_with_bot_function_name"]}" diff --git a/twilio-iac/helplines/zm/templates/studio-flows/messaging-webchat.tftpl b/twilio-iac/helplines/zm/templates/studio-flows/messaging-webchat.tftpl index 0c1cf268e2..4d56680d22 100644 --- a/twilio-iac/helplines/zm/templates/studio-flows/messaging-webchat.tftpl +++ b/twilio-iac/helplines/zm/templates/studio-flows/messaging-webchat.tftpl @@ -375,6 +375,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/helplines/zm/templates/studio-flows/messaging.tftpl b/twilio-iac/helplines/zm/templates/studio-flows/messaging.tftpl index 9e12831a10..5d24992bbf 100644 --- a/twilio-iac/helplines/zm/templates/studio-flows/messaging.tftpl +++ b/twilio-iac/helplines/zm/templates/studio-flows/messaging.tftpl @@ -340,6 +340,14 @@ ${ { "value": "preSurveyComplete", "key": "releaseFlag" + }, + { + "value": "{{trigger.message.ChannelAttributes.channel_type | downcase}}", + "key": "channelType" + }, + { + "value": "false", + "key": "isConversation" } ], "url": "${serverless_url}/channelCapture/captureChannelWithBot" diff --git a/twilio-iac/terraform-modules/channels/v1/main.tf b/twilio-iac/terraform-modules/channels/v1/main.tf index 2cb8caa5fd..677cc894d6 100644 --- a/twilio-iac/terraform-modules/channels/v1/main.tf +++ b/twilio-iac/terraform-modules/channels/v1/main.tf @@ -118,7 +118,7 @@ resource "aws_ssm_parameter" "channel_flex_flow_sid" { for idx, channel in var.channels : idx => channel if(channel.channel_type == "custom" && channel.messaging_mode == "programmable-chat") } - name = "/${lower(var.environment)}/twilio/${nonsensitive(var.twilio_account_sid)}/flex_flow_sid" + name = "/${lower(var.environment)}/twilio/${nonsensitive(var.twilio_account_sid)}/${each.key}_flex_flow_sid" type = "SecureString" value = twilio_flex_flex_flows_v1.channel_flow[each.key].sid description = "${title(replace(each.key, "_", " "))} Flex Flow SID"