diff --git a/app/controllers/api/v1/accounts/inboxes_controller.rb b/app/controllers/api/v1/accounts/inboxes_controller.rb index 0f573bbb9..6c078d28f 100644 --- a/app/controllers/api/v1/accounts/inboxes_controller.rb +++ b/app/controllers/api/v1/accounts/inboxes_controller.rb @@ -89,6 +89,8 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController :webhook_url, :email, :reply_time, + :pre_chat_form_enabled, + { pre_chat_form_options: [:pre_chat_message, :require_email] }, { selected_feature_flags: [] } ]) end diff --git a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json index 8c3f5624b..55ba4a0ff 100644 --- a/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json +++ b/app/javascript/dashboard/i18n/locale/en/inboxMgmt.json @@ -224,7 +224,8 @@ "TABS": { "SETTINGS": "Settings", "COLLABORATORS": "Collaborators", - "CONFIGURATION": "Configuration" + "CONFIGURATION": "Configuration", + "PRE_CHAT_FORM": "Pre Chat Form" }, "SETTINGS": "Settings", "FEATURES": { @@ -250,6 +251,23 @@ "SUBTITLE": "Your Facebook connection has expired, please reconnect your Facebook page to continue services", "MESSAGE_SUCCESS": "Reconnection successful", "MESSAGE_ERROR": "There was an error, please try again" + }, + "PRE_CHAT_FORM": { + "DESCRIPTION": "Pre chat forms enable you to capture user information before they start conversation with you.", + "ENABLE": { + "LABEL": "Enable pre chat form", + "OPTIONS": { + "ENABLED": "Yes", + "DISABLED": "No" + } + }, + "PRE_CHAT_MESSAGE": { + "LABEL": "Pre Chat Message", + "PLACEHOLDER": "This message would be visible to the users along with the form" + }, + "REQUIRE_EMAIL": { + "LABEL": "Visitors should provide their name and email address before starting the chat" + } } } } diff --git a/app/javascript/dashboard/routes/dashboard/settings/inbox/PreChatForm/Settings.vue b/app/javascript/dashboard/routes/dashboard/settings/inbox/PreChatForm/Settings.vue new file mode 100644 index 000000000..6c01bc3dd --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/inbox/PreChatForm/Settings.vue @@ -0,0 +1,128 @@ +