Search.../

onMessageSentToParticipant( )

Developer Preview

Triggered when the business sends a message to a visitor, contact, or member.

Syntax

function wixCrmInbox_onMessageSentToParticipant(event: MessageSentToParticipantEvent): void

onMessageSentToParticipant Parameters

NAME
TYPE
DESCRIPTION
event
Optional
MessageSentToParticipantEvent

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event triggered when the business site messages the site user

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_onMessageSentToParticipant(event) {
6 const eventId = event.metadata.id;
7 const messageId = event.data.message._id;
8 const conversationId = event.data.conversationId;
9 }
10
11/* Full event object:
12 * {
13 * "data": {
14 * "conversationId": "6fd2b962-dd8f-382f-8d27-ae63f188c939",
15 * "message": {
16 * "_createdDate": "2023-11-15T16:18:56.558Z",
17 * "_id": "1700065136558061",
18 * "appId": "151e476a-715e-ec33-db9a-a7ff4d51f70a",
19 * "badges": [],
20 * "content": {
21 * "previewText": "Thank You",
22 * "basic": {
23 * "items": [
24 * {
25 * "text": "Thank you for submitting!"
26 * }
27 * ]
28 * },
29 * "contentType": "BASIC"
30 * },
31 * "direction": "BUSINESS_TO_PARTICIPANT",
32 * "sender": {
33 * "wixUserId": "b17c523c-6ec9-4b56-9d9d-123cc6978bdf"
34 * },
35 * "sequence": "1700065136558061",
36 * "sourceChannel": "UNKNOWN_CHANNEL_TYPE",
37 * "targetChannels": [],
38 * "visibility": "BUSINESS_AND_PARTICIPANT"
39 * },
40 * }
41 * "metadata": {
42 * "id": "2715920c-e7d4-4bd0-ab00-33cb3fe01a9f",
43 * "entityId": "1700065136558061",
44 * "eventTime": "2023-11-15T16:18:56.681603Z",
45 * "triggeredByAnonymizeRequest": false
46 * }
47 * }
48 */