Newer Version Available

This content describes an older version of this product. View Latest

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.

Response

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.

Example

Component code:

1<lightning:messageChannel type="lightning__conversationAgentSend" scope="APPLICATION" 
2                          onMessage="{!c.onConversationAgentSend}" />

Controller code:

1({
2    onConversationAgentSend: function(cmp, evt, helper) {
3        var recordId = evt.getParam("recordId");
4        var content = evt.getParam("content");
5        var name = evt.getParam("name");
6        var timestamp = evt.getParam("timestamp");
7
8        console.log("recordId:" + recordId + " content:" + content + " name:" + name + " timestamp:" + timestamp);
9    }
10})