Search.../

onMessageButtonInteracted( )

Developer Preview

Triggered when a postback button is clicked.

Syntax

function wixCrmInbox_onMessageButtonInteracted(event: MessageButtonInteracted): void

onMessageButtonInteracted Parameters

NAME
TYPE
DESCRIPTION
event
Optional
MessageButtonInteracted

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event triggered when a postback button is clicked

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3// Add the file if it doesn't exist.
4
5export function wixCrmInbox_onMessageButtonInteracted(event) {
6 const eventId = event.metadata.id;
7 const messageId = event.data.message._id;
8}
9
10/* Full event object:
11 * {
12 * "data": {
13 * "appId": "151e476a-715e-ec33-db9a-a7ff4d51f70a",
14 * "conversationId": "6fd2b962-dd8f-382f-8d27-ae63f188c939",
15 * "interactedBy": {
16 * "contactId": "9e668c08-8bdb-4240-babb-8176935f6f78"
17 * },
18 * "interactionId": "spa_day_54321__change_appointment"
19 * },
20 * "metadata": {
21 * "entityId": "4b0d9a97-7c33-4ee9-945d-6a2f82d2f26d",
22 * "eventTime": "2023-11-15T15:24:51.096099Z",
23 * "id": "4fe18293-0a00-4650-be2e-ba754ee5cba0",
24 * "triggeredByAnonymizeRequest": false
25 * }
26 * }
27 */
28
29