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.

NameTypeDescription
recordIdStringThe ID of the record for the Messaging session.
messageTypeStringThe message component type to send on behalf of the service rep. For example, StaticContentMessage. See Message Types and Message Format Types.
nameOrIdStringThe name or ID of the messaging component to send on behalf of the service rep.
textStringOptional. 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.