// Types:
sendMessage: (payload: TeamTextMessagePayload |
TeamRichMessagePayload |
CustomerMessagePayload |
DynamicComponentPayload) => Promise<void>;
// Example:window.AE_SDK((thrownError, AE_SDK) => {
AE_SDK.sendMessage({
type: "TeamTextMessage",
message: "This is a Team message!",
options: { senderName: "Team of Experts" }
});
});
Sends a message to timeline. This function supports 4 different payloads:
Team Text Message - for a plain text message which will be sent from the expert to the customer.
Team Rich Message - for a pre-defined message component which will be sent from the expert to the customer.
Customer Message - for a plain text message which will be sent from the customer to the expert (either hidden or not), this message will initiate a session. If the user already has an ongoing session, then this method won't send the message.
Dynamic Component - for rendering a component message which will be sent from the expert to the customer.
Rather the message would be hidden from customer's timeline
false
Customer Message can be used only if the customer is not in a session yet, meaning that this function can be called as the first message on the timeline, and not otherwise.