To accurately capture customer information in Zendesk tickets from Twilio Flex, you need to configure the integration so the Requester field is set to the customer’s email address.
Voice & SMS
For Voice and SMS tasks, setting the Requester field in Zendesk is straightforward and only involves updating the Studio Send to Flex widget.
Studio "Send to Flex" Widget
In the Send to Flex widget, set the name
property within the Attributes field to the customer’s email address.
WebChat
Webchat Tasks require an extra step, as these Tasks are handled differently by the Flex Zendesk integration.
Update "channelType" Task Attribute
The channelType
Task attribute for incoming Webchat Tasks needs to be set to sms
(instead of web
).
This can be achieved by using a Flex plugin that updates the channelType
. With Flex UI Actions, you can trigger the update just before the Task is accepted.
Sample Plugin Code
async init(flex, manager) {
flex.Actions.addListener("beforeAcceptTask", payload => {
if(payload.task.attributes.channelType === 'web') {
await flex.Actions.invokeAction("SetTaskAttributes", {
sid: payload.sid,
attributes: {
channelType: "sms"
},
mergeExisting: true
})
}
})
}
Studio "Send to Flex" Widget
After deploying your plugin, configure the Send to Flex widget attribute field to set the name
property to the customer’s email address, using pre-engagement data:
"name": "{{trigger.conversation.ChannelAttributes.pre_engagement_data.email}}"
Included in the Widget, that would look like so:
Validate the Integration
After implementing these steps, start a new Webchat.
The Requester field in the resulting Zendesk ticket should now be populated with the customer’s email address.
Additional Information
For more resources on customizing your Flex-Zendesk integration, setting up and using Webchat, and working with pre-engagement data, refer to the following:
- Customize your Flex-Zendesk Integration
- Set Up and Use Webchat 3.x.x
- Accessing and Using Pre-Engagement Data and Context