Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

Email Accept Screenpop

Creating the Email Accept Screenpop Script

Screenpops in Genesys PureCloud are performed by scripts created in the Admin console and invoked by the call flows managed in Architect. In this section we will be creating a script capable of triggering an OpenMethods Popflow screenpop from scratch. You may also import the following example script and modify it for your environment.

Insert Script Here

  1. Log in to Genesys PureCloud and select Collaborate / Communicate

Image RemovedImage Added
  1. Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)

Image RemovedImage Added
  1. Find the Contact Center section of the Admin screen and click Scripts (highlighted in red) to list current scripts

Image RemovedImage Added
  1. Click the Create button to create a new script. This will start script creation process

  1. Give this script a name to indicate it’s purpose, such as OM Email ScreenPop. Make sure the Blank Script template is selected and click the Create button to open the script editor

  1. Open the Actions tab of the tool box panel on the right side of the screen

Image RemovedImage Added
  1. Click the “+” button to the right of Actions to add a new custom action to the script and bring up the Action editor screen

  1. Provide the action with a name, for example “Call OpenConnect API” and click the Add Step button to add a step to the custom action

  1. Click the downward pointed arrow next to Scripter to expand the section

  1. Scroll down in the popup panel and click Open URL from the list to add the step to the action editor screen

  1. In the Open URL step section of the action editor screen, enable Open in New Window and change the default width and height of the window to something small. In the example we use 50x50. This window will automatically close as part of the screen pop process

  1. Add the base Connect API url into the URL text area (including the '?' at the end)

North America: https://connect.openmethodscloud.com/api/sendmessage/bc/CTI?
Europe/GDPR: https://connect.gdpr.openmethodscloud.com/api/sendmessage/bc/CTI?

Image RemovedImage Added
  1. Add the jwt parameter to the url with the API Key obtained during the first step as the value. Keep in mind your API Key will be very long

  1. Add the event parameter to the url with “Email+Accept” as the value (Don’t forget to put the ‘&' in front of 'event’

  1. Add the agentId parameter to the url. The value will be added in the next steps

  1. Click on the Insert Variable button above the text area to bring up the variable selection popup panel. Make sure the text cursor is located after the '=' for the agentId parameter or the value will be put in the wrong place

  1. Scroll down to and select Scripter.Agent Email from the list to automatically add the value to the url field

  1. Add the mediaType parameter to the url with “Email” as the value (Don’t forget to put the ‘&' in front of 'mediaType’

  1. Click the '+' sign in the right panel to add a custom variable to the script

  1. Click ‘String’ under Basic Types

  1. Give the variable a name like ‘rnIncidentId’. Enable the Input slider. Click Apply to create the variable.

  1. Add the rnIncidentId parameter to the url. The value will be added in the next steps

  1. Click on the Insert Variable button above the text area to bring up the variable selection popup panel. Make sure the text cursor is located after the '=' for the rnIncidentId parameter or the value will be put in the wrong place

  1. Scroll down to and select rnIncidentId from the list to automatically add the value to the url field

  1. Click the Save button to save the custom action

  1. Click the Script menu button at the top of the script editor page to bring up the Script menu

  1. Select the Script Properties menu item to bring up the Script Properties panel on the right side of the script editor

  1. Click on Email to expand the options for inbound emails

  1. Click the slider to enable this script for emails

  1. Click the page icon at the bottom of the editor to open the main script properties panel on the right side of the editor

  1. Click the Page Load Action to bring up the action selection panel

  1. Click the Custom drop-down to expand the custom section

  1. Click the ‘Call OpenConnect API’ action

  1. Click the Select button to select the action

  1. Click the Script menu button again to bring up the script menu

Image RemovedImage Added
  1. Click the Save menu option to save the script

Image RemovedImage Added
  1. A notification will display in the upper right corner of the script editor to indicate the script was saved

Image RemovedImage Added
  1. Click the Script menu button again to open the script menu and click Publish to publish the script to make it available for use in call flows

Image RemovedImage Added
  1. As with Save, a notification will be displayed when the script has finished being published

  1. Log out of the PureCloud application

Create Inbound Email Flow

Image Added
  1. Log in to PureCloud as an administrator and click Architect to open the PureCloud Architect application

Image Added

  1. Hover over the workflow selector in the upper left corner and select Inbound Email from the pop-up menu

Image Added

  1. Click ‘+ Add’ to create a new workflow

Image Added

  1. Give the workflow a name and click ‘Create Flow’

Image Added

  1. Click ‘Data’ in the left-hand navigation

Image Added

  1. Enter ‘rnIncidentId’ and click ‘Create’ to add a variable to hold the incident id

Image Added

  1. Click ‘Initial State’ in the left-hand navigation to return to the design canvas

Image Added

  1. Click the data icon to bring up the pop-up menu. Drag and drop the Get Participant Data action onto the Start block in the designer canvas

Image Added

  1. Put ‘rnIncidentId’ into the Attribute Name field. Put ‘Flow.rnIncidentId’ into the Variable to Assign field

Image Added

  1. Hover over the flow icon to bring up the pop-up menu. Drag and drop the Set Screen Pop action onto the arrow between the Get Participant Data and Disconnect blocks in the designer canvas

Image Added

  1. Click the script selection drop-down, and select the script created in the last section

Image Added

  1. Click the type selector and click on Expression

Image Added

  1. Enter ‘Flow.rnIncidentId’ into the rnIncidentId field

Image Added

  1. Click Save to save the workflow

Image Added

  1. Click Publish to publish the workflow

Email Close Screenpop

Add WebApp Integration

If you have already done this for another media type, you do not need to do it again.

Image Added
  1. Log in to Genesys PureCloud and select Collaborate / Communicate

Image Added
  1. Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)

Image Added

  1. Click “Integrations” in the Integrations section

Image Added

  1. Click “+ Integrations” to add a new integration

Image Added

  1. Scroll down and find “Web Services Data Actions” and click install

Image Added

  1. Enable the integration by clicking the “Inactive” slider

Image Added

  1. Confirm the activation by clicking “Yes”

Image Added

  1. Save the changes to the integration by clicking “Save”

Add Email Close Data Action

If you have already created a data action for another media type, you do not have to do it again.

Image Added
  1. Log in to Genesys PureCloud and select Collaborate / Communicate

Image Added
  1. Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)

Image Added
  1. Click “Actions” under the Integrations section

Image Added

  1. Click “Add Action”

Image Added

  1. Select the integration created in the previous section

Image Added

  1. Provide a name for the new action and click “Add”

Image Added

  1. Click “Setup” to configure the action

Image Added

  1. Switch to the JSON view for both Input Contract and Output Contract

Image Added

  1. Copy and paste the text below into the Input Contract text area

Code Block
languagejson
{
  "type": "object",
  "properties": {
    "jwt": {
      "type": "string"
    },
    "ANI": {
      "type": "string"
    },
    "agentId": {
      "type": "string"
    },
    "event": {
      "type": "string"
    }
  },
  "required": ["jwt", "ANI", "agentId", "event"]
}

Image Added

  1. Copy and paste the text below into the Output Contract text area

Code Block
languagejson
{
  "type": "object",
  "properties": {
    "result": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  }
}

Image Added

  1. Click “Configuration”

Image Added

  1. Click “GET” to open the context menu and select “POST”

Image Added

  1. Fill out the request url depending on your location
    North America: https://connect.openmethodscloud.com/api/sendmessage/CTI
    Europe/GDPR: https://connect.gdpr.openmethodscloud.com/api/sendmessage/CTI

Image Added

  1. Copy and paste the text below into the Request Body Template text area

Code Block
languagejson
{
  "jwt": "${input.jwt}",
  "agentId": "${input.agentId}",
  "event": "${input.event}",
  "ANI": "${input.ANI}"
}

Image Added

  1. Click “Save & Publish”

Image Added

  1. Confirm the publish request by clicking “Yes”

Create Email Close Workflow

Image Added
  1. Log in to PureCloud as an administrator and click Architect to open the PureCloud Architect application

Image Added

  1. Change the flow type by clicking Flows: Inbound Call and selecting Workflow

Image Added
  1. Click “Add” to create a new workflow

Image Added

  1. Provide a name for the new workflow and click “Create Flow”

Image Added

  1. Click the Data item of the Resources section in the left-hand navigation panel

Image Added

  1. Enter “userId” into the variable name field and click “Create”

Image Added

  1. Click “Flow.userId” to open the edit dialog box

Image Added

  1. Enable the “Input to flow” checkbox and click “Save”

Image Added

  1. Click “Initial State” item of the Starting State section in the left-hand navigation panel

Image Added

  1. Click the Binoculars icon to open the sub menu. Click and drag the Find User by ID action onto the start block in the workflow canvas

Image Added

  1. Enter ‘Flow.userId’ into the User ID field. Enter Flow.user into the User Result field

Image Added

  1. Click the Database icon to open the sub menu. Click and drag the Call Data Action onto the Found path below the Find User by ID block in the workflow canvas

Image Added

  1. Give the action a name

Image Added

  1. Select “Web Services Data Action” from the Category drop-down

Image Added

  1. Select “OpenMethods OpenConnect” (or the name you chose) from the Data Action drop-down

Image Added

  1. Provide your company’s JWT (this was obtained at the top of this guide

Image Added

  1. Click the page icon next to the ANI field and select “Expression” from the context menu

Image Added

  1. Leave the ““ as the value

Image Added

  1. Click the page icon next to the agentId field and select “Expression” from the context menu

Image Added

  1. Enter “Flow.user.username” into the agentId field

Image Added

  1. Enter “Email Close” into the event field

Image Added

  1. Any additional steps for error handling is an exercise for the reader

Image Added

  1. Click Save to save the workflow

Image Added

  1. Click Publish to publish the workflow

Create Email Close Trigger

Image Added
  1. Log in to Genesys PureCloud and select Collaborate / Communicate

Image Added
  1. Navigate to the Admin screen by clicking Admin in the top bar (highlighted in red)

Image Added
  1. Click the Triggers link under Architect

Image Added

  1. Click Add Trigger

Image Added

  1. Give the trigger a name and description. Click Add to create the trigger

Image Added

  1. Select 'v2.detail.events.conversation.{id}.user.end from the Topic Name drop-down

Image Added

  1. Select OpenMethods Email Close from the Workflow Target drop-down

Image Added

  1. Click Add Condition to filter when the trigger is fired

Image Added

  1. Enter ‘mediaType’ into the JSON Path field. Select Equals (==) from the Operator drop-down. Enter ‘'EMAIL'’ into the Value field

Image Added

  1. Click Create to finish creating the trigger