SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Twilio Flex + Zendesk Integration: Set Customer Email as Requester

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.

Note: If you haven’t set up the Twilio Flex and Zendesk integration yet, please review our official guide first.

 

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.

 

SendMessageToFlex - Task Attributes.png

 

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
})
}
})
}
Note: This code sample is for demonstration purposes. Before incorporating this code into your environment, carefully review, customize, and thoroughly test it to ensure it meets your production requirements. Twilio is not responsible or liable for any issues that may arise if you use this code without proper modification and validation.

 

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:

SendConversationToFlex - Task Attributes.png

 

Validate the Integration

After implementing these steps, start a new Webchat. 

Webchat Pre-Engagement Form.png

 

The Requester field in the resulting Zendesk ticket should now be populated with the customer’s email address.

Twilio Flex Zendesk Integration.png

 

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:

 

Have more questions? Submit a request
Powered by Zendesk