lightning__conversationAgentSend
Messaging event triggered when an agent sends a message through the Salesforce console. This method intercepts the message before it’s sent to the chat visitor. This event is also triggered when using Enhanced Messaging channels. To work with Enhanced Messaging channels, the session must be active and the Enhanced Conversation Component must be visible on the page.
| Name | Type | Description |
|---|---|---|
recordId | String | The ID of the work record that’s associated with the current conversation. |
content | String | The text of the message in the conversation log. |
name | String | The name of the agent who is attempting to send the message. This name matches the agent name displayed in the conversation log. |
timestamp | Date/Time | The date and time that the agent attempted to send the message. |
To listen to the lightning__conversationAgentSend event, import the Lightning Message Service features from lightning/messageService and pass the event to the subscribe() method.
Component code:
Controller code: