You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now your customers are ready to create tickets and start inquiry with your agents!
50
50
51
+
## Setting customer customFields
52
+
53
+
Customer information could be kept in `customFields`. `setCustomerCustomFields()` in `SendBirdDesk` lets the SDK set the `customFields` of the current customer. The `customFields` columns should be defined in SendBird Dashboard beforehand. Otherwise, the setting would be ignored.
54
+
```js
55
+
SendBirdDesk.setCustomerCustomFields({
56
+
gender:'male',
57
+
age:20
58
+
},
59
+
err=> {
60
+
if (!err) {
61
+
// customer's customFields is rightly set
62
+
// (or a certain key could get ignored if the key is not defined yet)
63
+
}
64
+
});
65
+
```
66
+
51
67
## Creating a new ticket
52
68
53
69
Creating a new ticket is as simple as calling `Ticket.create()`. Once you create the ticket, you can access to created ticket and channel in callback. Channel object can be found at `ticket.channel` so that you can send messages to the channel. For more information in sending messages to channel, see [SendBird SDK guide docs](https://docs.sendbird.com/android#group_channel_3_sending_messages).
If Desk satisfaction feature is on, a message would come after closing the ticket. The message is for getting customer feedback including score and comment. The data of satisfaction form message looks like below.
185
+
186
+
```js
187
+
{
188
+
"type":"SENDBIRD_DESK_CUSTOMER_SATISFACTION",
189
+
"body": {
190
+
"state":"WAITING"// also can have "CONFIRMED",
191
+
"customerSatisfactionScore":null, // or a number ranged in [1, 5]
192
+
"customerSatisfactionComment":null// or a string (optional)
193
+
}
194
+
}
195
+
```
196
+
197
+
Once the customer inputs the score and the comment, the data could be submitted by calling `SendBirdDesk.Ticket.submitFeedback(message, score, comment, callback)`. Then updated message is going to be sent in `channelHandler.onMessageUpdate(channel, message)`.
To send URL preview message, you should send a text message with URL, extract preview data, and update it with the preview data. Use `channel.updateUserMessage(messageId, text, messageData, customType, callback)` for the update operation. The format of `messageData` looks like below:
Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "sendbird-desk",
3
-
"version": "1.0.7",
3
+
"version": "1.0.8",
4
4
"description": "SendBird Desk SDK Integration Guide for JavaScript =========== SendBird Desk is a chat customer service platform built on SendBird SDK and API.",
0 commit comments