You are here:
Embedded Messaging Set Up
Configure Embedded Messaging in the Employee Portal site to help your employees get instant help and case statuses by chatting with a bot or a service representative.
Required Editions
| View supported editions. |
To set up Embedded Messaging, perform these tasks:
- Prepare a Salesforce org.
- Configure a deployment.
- Optionally, set up a pre-chat form.
- Add the Embedded Messaging component to the Employee Portal site.
- Configure the component.
- Add your domain to the Cross-Origin Resource Sharing (CORS) allowlist.
See Embedded Messaging.
During the setup, when you configure a web deployment, add a similar JavaScript code within a <script> tag to use Pre-Chat API to pass an employee's user ID to the Omni-Channel flow. See Configure an Enhanced Web Chat Deployment in an Experience Builder or Commerce Cloud site.
<script>
window.addEventListener("onEmbeddedMessagingReady", e => {
const userId = $A.get("$SObjectType.CurrentUser.Id");
console.log("User id is:"+userId);
embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields({
"userId": userId});
});
</script>
The Omni-Channel flow retrieves the employee's account ID, contact ID, and full name and updates the messaging session record with these details. With the updated messaging session record, service representatives see the employee's name in every incoming chat message notification.
To hide the pre-chat form from the employee, add the User ID field as a hidden pre-chat field. See Customize Pre-Chat for Messaging for In-App and Web.
- Update Messaging Session with Employee Details
When an employee contacts a service representative through chat, the service representative receives an incoming chat notification in HR Service Console. To show the name of the employee in the notification, the messaging session record must contain the employee's account ID, contact ID, and full name. To update the messaging session record with these details, create an autolaunched flow and update the Omni-Channel flow. - Set Up Case Management Bot
Configure Embedded Messaging with a case management bot. With the bot, your employees can create cases and find case statuses rapidly.

