sendMessagingComponent() for LWC for Lightning Experience
Sends a new message with a specified messaging component on behalf of the service rep. You can also use this method to send a text message. This method works only in Lightning console apps.
| Name | Type | Description |
|---|---|---|
recordId | String | The ID of the record for the Messaging session. |
| messageType | String | The message component type to send on behalf of the service rep. For example, StaticContentMessage. See Message Types and Message Format Types. |
| nameOrId | String | The name or ID of the messaging component to send on behalf of the service rep. |
| text | String | Optional. The message to the end user. For example: This is a sample message. |
Returns a Promise. Success resolves to true. The Promise is rejected if there’s an error.
This example sends a static content message on behalf of the service rep.