sendMessage() for Lightning Experience
Sends a new chat message from the agent to a chat with a specific chat key. This method works only in Lightning console apps.
| Name | Type | Description |
|---|---|---|
argumentObj | Object | An object containing all the arguments to be passed into this method. |
| Name | Type | Description |
|---|---|---|
recordId | String | The ID of the chat that you want to end. |
message | Object | An object containing the data to send in the message. |
| Name | Type | Description |
|---|---|---|
text | String | The text to be sent in the message. |
This example sends a message to the visitor and logs the result.
Component Code:
Controller Code:
Returns a Promise. Success resolves to true. The Promise is rejected if there’s an error.