Sending chat transcripts to users via email
To create an intent and entity to email a chat transcript
- Log in to IBM Watson Assistant and navigate to the Intents tab.
- Create the emailtranscript intent and provide examples such as I need the transcript of this chat or Send chat transcript.
- Click the Back option.
- Select Entities > MyEntities.
- Create the emailTranscript entity, and add now and later as the entity values, as shown in the image below:
To create a dialog node to email a chat transcript
- Log in to the IBM Watson Assistant and navigate to the Dialogs tab.
- Create the BMC Email Chat Transcript dialog.
- In the conditions, add the emailTranscript intent name.
- Under Then set context, for the $ sys_options variable, enter the following value:
[{"label":"Send now","value":"now"},{"label":"Send later","later":"no"}] - Under Assistant responds, under Text, enter the following text that the user sees as a response:
I can send the transcript of the chat now, which will end the chat, or I can send it after completing the chat.
The following image shows the configuration for the BMC Email Chat Transcript node: Create the child dialog nodes and configure them as specified in the following table:
Child dialog node
Action
Send now
- In If assistant recognizes, enter emailTranscript:now.
In the JSON editor, enter the following content:
{
"output": {
"text": {
"values": [
"Chat transcript sent to
$primaryEmailAddress. Have a good day"
],
"selection_policy":
"sequential"
},
"action": {
"inputMap": {
"chatId":
"$chatId",
"enableChatTranscript": true
},
"actionTypeName":
"shouldSendChatTranscript",
"waitForActionExecution": true
}
},
"context": {
"bmcSessionEmailChat": true
}
}The following image shows the configuration for the Send now node:
- For the Send now dialog, create the Close chat child dialog node, and specify the following details for the Close chat node:
- If assistant recognizes—Enter True.
JSON editor—Enter the following content:
{
"output": {
"text": {
"values": [
""
],
"selection_policy":
"sequential"
},
"action": {
"actionTypeName":
"clearChatContext"
}
}
}The following image shows the configuration for the Close chat node:
Send Later
- In If assistant recognizes, enter emailTranscript:later.
In the JSON editor, enter the following content:
{
"output": {
"text": {
"values": [
"Okay, I'll send it later. You can
continue with the chat now."
],
"selection_policy":
"sequential"
}
},
"context": {
"bmcSessionEmailChat": true
}
}The following image shows the configuration for the Send later node:
Start over
- In If assistant recognizes, enter emailTranscript:!@start-over.
In the JSON editor, enter the following content:
{
"output": {
"generic": [
{
"response_type":
"text",
"values": [],
"selection_policy":
"sequential"
}
]
},
"context": {
"sys_options": []
}
}- In Then assistant should, select Jump to > BMC Email Chat Transcript (Evaluate responses), as shown in the following image:
You have successfully created the dialog nodes to enable users to receive a chat transcript by entering the required phrase in the chat.
The following image shows how the bot prompts a user to specify when the user wants the chat transcript: