Share agent assistance suggestions using text messages during phone calls
Agents can click each suggestion to go into the detail view of the suggestion and can click the link in the suggestion to open the associated KM article.
If the shareSuggestionsExternally
setting is enabled, agent can see a
share using the text message button in the detail view of the suggestion. If an SR is
associated in the IVR data of the phone call, an agent can see a share using email
button in the detail view of the suggestion.
It's assumed you've completed the prerequisites and added the code for sharing suggestions externally.
Once the call is in progress, you'll see agent assistance suggestions in the Fusion application. You can click a suggestion to go into the detail view of the suggestion where there will be a Share via text message icon there.
The following flow diagram shows the sequence of operations performed once the agent clicks on the Share via text message button in the snippet suggestion:
- If the
shareSuggestionsExternally
parameter is set as true the agent can see a Share via text message button in the drill-down view of the snippet. The agent clicks the button to send the suggestion as text messages to the customer. - The
onToolbarInteractionCommand
event listener in the media toolbar application is executed with the command ofonSuggestionShared
. The event payload contains suggestion information such asexternalUrl
, suggestion text, and so on. From thiseventlistener
, for theonSuggestionShared
command, you need to call your supplier or SMS provider API to send the text message. - Your SMS supplier sends the SMS and responds whether the status is success or
failure. If the SMS share status is success, a resolved promise is returned from
the
onToolbarInteractionCommand
event listener withcommandObject.result='success'
, and if the SMS share status is failure, a resolved promise is returned from theonToolbarInteractionCommand
event listener withcommandObject.result='failure'
.If the
commandObject.result
is set as success, the following message:The article titled {ARTICLETITLE} has been shared with the customer through SMS
is shown in the call transcript as a message to the agent.If the
commandObject.result
is set as failure, the following message:Failed to share the article titled {ARTICLETITLE} with the customer through SMS
is shown in the call transcript as a message to the agent.
How to send the suggestion as a SMS through your CTI supplier
- In the
ICtiVendorHandler.ts
file, add theshareSuggestionExternally
declaration for thesendTextMessage
function:export interface ICtiVendorHandler { //... sendTextMessage(suggestionData: IMcaOnToolbarInteractionCommandData, resolveRef: Function): Promise<void>; //... }
- Update
subscribeToToolbarInteractionCommandsFromFusion
in thefusionHandler.ts
file withshareSuggestionExternally
:public static subscribeToToolbarInteractionCommandsFromFusion(callback: Function): void { const request: IMcaEventRequest = FusionHandler.frameworkProvider.requestHelper.createSubscriptionRequest('onToolbarInteractionCommand') as IMcaEventRequest; FusionHandler.phoneContext.subscribe(request, (eventResponse: IEventResponse) => { return new Promise((resolve, reject) => { const eventResponseDetails: IMcaOnToolbarInteractionCommandDataResponse = (eventResponse as IMcaOnToolbarInteractionCommandEventResponse).getResponseData(); callback(eventResponseDetails.getCommand(), eventResponseDetails.getData(), resolve); }) }); }
- Update the
subscribeToToolbarInteractionCommandsFromFusion
function call from themakeAgentAvailable
function in theintegrationEventsHandler.ts
file to handle the new parameters as shown in the following example:public async makeAgentAvailable(): Promise<void> { try { //... FusionHandler.subscribeToToolbarInteractionCommandsFromFusion((command: string, suggestionData: IMcaOnToolbarInteractionCommandData, resolveRef: Function) => { this.listenToToolbarInteractionCommandsFromFusion(command, suggestionData, resolveRef); }); //... } catch (err) { //... } }
- Update the
listenToToolbarInteractionCommandsFromFusion
function signature to handle the new parameters and add a case for theonSuggestionShared
command as shown example:public listenToToolbarInteractionCommandsFromFusion(command: string, suggestionData: IMcaOnToolbarInteractionCommandData, resolveRef: Function): void { switch (command) { //... case "onSuggestionShared": this.ctiAppViewModel.shareSuggestionExternally(suggestionData, resolveRef); //... } }
- Define the
functionshareSuggestionExternally
in theappController.ts
file as shown in the following example:public shareSuggestionExternally: (suggestionData: IMcaOnToolbarInteractionCommandData, resolveRef: Function) => void = (suggestionData: IMcaOnToolbarInteractionCommandData, resolveRef: Function): void => { this.integrationActionHandler.shareSuggestionExternally(suggestionData, resolveRef).then(() => { console.log("Requested to send message") }).catch(() => { console.log("Error: Unable to accept the call.") }); }
- Define the function
shareSuggestionExternally
in theintegrationActionHandler.ts
file as shown in the following example:public async shareSuggestionExternally(suggestionData: IMcaOnToolbarInteractionCommandData, resolveRef: Function): Promise<void> { await this.vendor.sendTextMessage(suggestionData, resolveRef); }
- Implement the logic to send message using your CTI supplier in the
vendorHandler.ts
file as shown in the following example:export class VendorHandler implements ICtiVendorHandler { //... public async sendTextMessage(suggestionData: IMcaOnToolbarInteractionCommandData, resolveRef: Function): Promise<void> { // TODO: call the vendor specific api to send text message // if(SMS SHARE STATUS FROM API RESPONSE IS 200 OR SUCCESS) suggestionData.result = 'success'; // else suggestionData.result = 'failure'; resolveRef(suggestionData); } //... }
Verify your progress
Once you complete these steps, use OJET serve to start you application and sign in to your Fusion application. Open the media toolbar and make your agent available for calls by clicking on the agent availability button. You can accept the call from your media toolbar application or from your Fusion application. Once the conversation is started, you can see the real-time transcripts are getting rendered in the Fusion engagement panel. You'll also see agent assistance suggestions are shown based on the suggestions. When you go to the drill down view of a particular suggestion, you'll see a Share via text message button. And when you click the button, the suggestion will be shared as a text message to the customer.