diff --git a/docs/docs/building/flex-hooks/components.md b/docs/docs/building/flex-hooks/components.md index a7728cd62..3027c42dc 100644 --- a/docs/docs/building/flex-hooks/components.md +++ b/docs/docs/building/flex-hooks/components.md @@ -38,6 +38,7 @@ enum FlexComponent { QueueStats = 'QueueStats', SideNav = 'SideNav', SupervisorTaskCanvasHeader = 'SupervisorTaskCanvasHeader', + TaskCanvas = 'TaskCanvas', TaskCanvasHeader = 'TaskCanvasHeader', TaskCanvasTabs = 'TaskCanvasTabs', TaskCard = 'TaskCard', diff --git a/docs/docs/feature-library/00_overview.md b/docs/docs/feature-library/00_overview.md index 662030a1d..57185c324 100644 --- a/docs/docs/feature-library/00_overview.md +++ b/docs/docs/feature-library/00_overview.md @@ -64,6 +64,7 @@ The **Flex Project Template** comes with a set of features enabled by default wi | [Omni Channel Management](omni-channel-capacity-management) | _method for mixing chat and voice channels_ | | | [Queues Stats Metrics](queues-stats-metrics) | _add custom metrics columns to the Queues View_ | | | [Ring Notification](ring-notification) | _plays a ringtone sound for incoming tasks_ | | +| [Salesforce Integration](salesforce-integration) | _example starting point for a custom Salesforce integration_ | | | [Scrollable Activities](scrollable-activities) | _allow the scrolling of the activities list_ | | | [SIP Support](sip-support) | _adds call control functionality when using a non-WebRTC phone_ | | diff --git a/docs/docs/feature-library/salesforce-integration.md b/docs/docs/feature-library/salesforce-integration.md new file mode 100644 index 000000000..185ac7b16 --- /dev/null +++ b/docs/docs/feature-library/salesforce-integration.md @@ -0,0 +1,134 @@ +--- +sidebar_label: salesforce-integration +title: salesforce-integration +--- + +## Overview + +This feature provides an enhanced Salesforce integration which replaces the out-of-box Salesforce integration plugin. It can be used as a starting point for customizing Salesforce integration functionality, which is not possible when using the out-of-box integration. + +Functionality included within this implementation: +- Activity logging + - Creates activity upon task completion or cancellation + - Includes agent copilot disposition and summary + - Relates the activity to the dialed or screen-popped record, or the agent-selected record +- Click-to-dial +- Screen pop +- UI enhancements + - Disables the pop-out and pop-in buttons while on a call, to prevent accidental call hangups + - Hides the CRM container when embedded + - Hides the Flex logo in the header to make room for additional buttons + - Opens the Flex panel automatically when click-to-dial is used or an inbound task is received + - Updates the utility bar item icon and label with the worker's current activity (if no tasks), incoming tasks, or the number of active tasks + - When screen pop returns multiple records, a dropdown is added to the interface for the agent to select the appropriate record for activity logging + +--- + +Example screenshot of handling an inbound call with UI enhancements and multiple screen pop results: + +![Salesforce integration screenshot](/img/features/salesforce-integration/salesforce-integration.png) + +--- + +## Business Details + +### Context + +Flex includes a Salesforce integration out-of-the-box, however, it is not fully customizable. If the out-of-box integration does not fully meet your needs, you may end up needing to build your own enhanced integration, re-creating the functionality included in the out-of-box integration. + +### Objective + +This `salesforce-integration` feature aims to be used as a starting point for your own customized Salesforce integration. The feature offers largely the same baseline functionality of the out-of-box integration, as well as some critical usability enhancements: + +- Disables the pop-out and pop-in buttons while on a call, to prevent accidental call hangups +- Interface enhancements that streamline the agent workflow +- When screen pop returns multiple records, a dropdown is added to the interface for the agent to select the appropriate record for activity logging + +### Configuration options + +The feature is functional only when Flex is embedded within Salesforce as described [in the Flex documentation](https://www.twilio.com/docs/flex/admin-guide/integrations/salesforce). If the out-of-box Salesforce integration has been [enabled within the Twilio Console](https://console.twilio.com/us1/develop/flex/settings/integrations/salesforce), it must first be disabled. + +To enable the feature, under the `flex-config` attributes set the `salesforce_integration` `enabled` flag to `true`. + +```json +"salesforce_integration": { + "enabled": true, + "activity_logging": true, // Enables the automatic creation of activity records when a task is completed or canceled + "click_to_dial": true, // Enables handling click-to-dial within Salesforce + "copilot_notes": true, // Adds agent copilot disposition and summary to activity records created by the feature + "hide_crm_container": true, // Hides the Flex CRM container when embedded within Salesforce + "prevent_popout_during_call": true, // Disables the pop-out or pop-in button while on a call, to prevent accidental hangups + "screen_pop": true, // Enables search and screen pop of Salesforce records based on the inbound task attributes + "show_panel_automatically": true, // Pops open Flex when a task is received or click-to-dial is performed + "utility_bar_status": true // Updates the utility bar item icon and label with the current activity (if no tasks), incoming task, or number of active tasks +} +``` + +#### Screen pop attributes + +When an inbound task is accepted, and the `screen_pop` configuration option is set to `true`, the feature will use task attributes in conjunction with the configured [Salesforce softphone layout](https://help.salesforce.com/s/articleView?id=service.cti_admin_phonelayouts.htm&type=5) to determine what record or page is displayed to the agent. Task attributes are used as follows: + +1. If the `sfdcObjectId` attribute is present, the Salesforce record ID contained within the attribute will be popped. No other attributes will be used for screen pop when this attribute is present. + 1. This can be useful when you are performing a data dip to find a record as part of the IVR and want to pop the same record. +1. Otherwise, a search within Salesforce will be performed, per the softphone layout, using the following task attributes in the following order: + 1. `name` + 1. `from` + 1. `identity` + 1. `customerAddress` + +## Technical Details + +The integration uses the [Salesforce Open CTI APIs](https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_intro.htm) and the [Lightning Console API](https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_js_getting_started.htm) to communicate with the Salesforce instance Flex is embedded within. + +### Initialization + +**File: `utils/SfdcLoader.ts`** + +**Flex hook: `pluginsInitialized` event** + +Before any integration functionality can be realized, we must first load the appropriate JS libraries from Salesforce. To do so, we load the Open CTI and Console API JS libraries from the Salesforce domain we are embedded within by inserting them as `