From 5dda138ee7e382e0902bb6e8a6448e085681a811 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Tue, 5 May 2026 14:14:39 +0700 Subject: [PATCH] feat(voice): inbox-level customizable WhatsApp call permission body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Surface inbox.provider_config['call_permission_request_body'] in the WhatsappCallingPage settings as an editable textarea — saving submits the new key alongside calling_enabled. Blank trims to null so the i18n default keeps applying. Backend reads the override before the i18n fallback. --- .../dashboard/i18n/locale/en/inboxMgmt.json | 5 ++++ .../settingsPage/WhatsappCallingPage.vue | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index c493db5ed..fa67d3de6 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -661,6 +661,11 @@ "HOW_IT_WORKS": { "LABEL": "How it works", "DESCRIPTION": "Calls are placed peer-to-peer between the agent's browser and Meta — no extra credentials are required. Make sure the agent's browser has microphone permission for this site." + }, + "PERMISSION_REQUEST_BODY": { + "LABEL": "Call permission request message", + "HELP_TEXT": "Shown to the contact when they haven't yet consented to receive calls. Leave blank to use the default.", + "PLACEHOLDER": "We would like to call you regarding your conversation." } }, "CHANNEL_PREFERENCES": "Channel Preferences", diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/WhatsappCallingPage.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/WhatsappCallingPage.vue index 5ae810159..2967209a2 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/WhatsappCallingPage.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/settingsPage/WhatsappCallingPage.vue @@ -3,12 +3,14 @@ import { useAlert } from 'dashboard/composables'; import SettingsFieldSection from 'dashboard/components-next/Settings/SettingsFieldSection.vue'; import SettingsToggleSection from 'dashboard/components-next/Settings/SettingsToggleSection.vue'; import NextButton from 'dashboard/components-next/button/Button.vue'; +import TextArea from 'next/textarea/TextArea.vue'; export default { components: { SettingsFieldSection, SettingsToggleSection, NextButton, + TextArea, }, props: { inbox: { @@ -19,6 +21,8 @@ export default { data() { return { callingEnabled: this.inbox.provider_config?.calling_enabled || false, + permissionRequestBody: + this.inbox.provider_config?.call_permission_request_body || '', isUpdating: false, }; }, @@ -33,6 +37,9 @@ export default { 'inbox.provider_config.calling_enabled'(val) { this.callingEnabled = val || false; }, + 'inbox.provider_config.call_permission_request_body'(val) { + this.permissionRequestBody = val || ''; + }, }, methods: { async updateCallingSettings() { @@ -45,6 +52,8 @@ export default { provider_config: { ...this.inbox.provider_config, calling_enabled: this.callingEnabled, + call_permission_request_body: + this.permissionRequestBody.trim() || null, }, }, }); @@ -75,6 +84,22 @@ export default { + +