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.

NameTypeDescription
recordIdStringThe ID of the work record that’s associated with the current conversation.
contentStringThe text of the message in the conversation log.
nameStringThe name of the agent who is attempting to send the message. This name matches the agent name displayed in the conversation log.
timestampDate/TimeThe 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: