> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: onMessageSentToBusiness(event: MessageSentToBusinessEvent) # Method package: wixInboxV2 # Method menu location: wixInboxV2 --> onMessageSentToBusiness # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/inbox/events/on-message-sent-to-business.md # Method Description: An event that triggers when a contact, member, or site visitor sends a message to a business. The `onMessageSentToBusiness()` event handler runs when a message is sent from a site's contact, member, or visitor to a business. The received `MessageSentToBusinessEvent` object contains information about the message that was sent. >**Note:** Backend events don't work when previewing your site. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event when the site user messages the business site ```javascript // Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixCrmInbox_onMessageSentToBusiness(event) { const eventId = event.metadata.id; const messageId = event.data.message._id; const conversationId = event.data.conversationId; } /* Full event object: * { * "data": { * "conversationId": "6fd2b962-dd8f-382f-8d27-ae63f188c939", * "message": { * "_createdDate": "2023-11-15T10:19:44.064Z", * "_id": "1700043584064712", * "appId": "14517e1a-3ff0-af98-408e-2bd6953c36a2", * "badges": [], * "content": { * "previewText": "You are very welcome.", * "basic": { * "items": [ * { * "text": "You are very welcome." * } * ] * }, * "contentType": "BASIC" * }, * "direction": "PARTICIPANT_TO_BUSINESS", * "sender": { * "contactId": "9e668c08-8bdb-4240-babb-8176935f6f78" * }, * "sequence": "1700043584064712", * "sourceChannel": "UNKNOWN_CHANNEL_TYPE", * "targetChannels": [], * "visibility": "BUSINESS_AND_PARTICIPANT" * } * }, * "metadata": { * "entityId": "1700043584064712", * "eventTime": "2023-11-15T10:19:45.472455Z", * "id": "45289008-1d03-4697-9cc2-a0c0f12cf823", * "triggeredByAnonymizeRequest": false * } * } */ ``` ---