Invite Users to Chat in Enhanced Web Chat
You can add an invitation that appears above the floating action button before a chat session begins. Create invitation conditions associated with your embedded service deployment in Setup. For more information on creating invitations in Setup, see Set Up and Customize an Automated Invitation.
To invoke automated invitations based on custom variables, use the invitationAPI.setCustomVariables method.
The invitation conditions created in Setup are custom variables that determine when to show an invitation.
This example snippet populates the invitation condition variables.
The values of the invitation variables are strings.
This example snippet removes the invitation condition variables.
Event listeners fire at various stages of the invitation process. There are three event listeners related to invitations.
onEmbeddedMessagingInvitationAcceptedonEmbeddedMessagingInvitationRejectedonEmbeddedMessagingInvitationShown
See Event Listeners for more information.