WeChat customer service session configuration

Updated at:

Configure user permissions

You can use the permission management features of Salesforce to assign permissions for employees to use WeChat customer service session data and features. The package provides a default identity system based on Permission Set Groups. It also includes Permission Sets designed with the appropriate level of granularity for different feature modules. You can assign permission set groups directly to users to grant permissions. You can also customize the provided permission sets to create roles that meet your specific needs. You must also manually create a permission set to grant users access to the CXG Connected App.

For more information about permission set groups, see Salesforce Permission Set Groups.

This topic describes how to configure permissions for customer service sessions.

Prerequisites

  1. The package is installed in your Salesforce organization.

  2. Go to Setup > Permission Set Groups and verify that the following two permission set groups are added to your organization:

    • CXG Admin

    • CXG WeChat Agent

      Note: The license for the permission sets in these permission set groups is set to Salesforce. Therefore, users without a Salesforce license, such as Chatter External or Service Cloud users, cannot be granted these permission sets.

Grant CXG Admin permissions

The CXG Admin permission set group is intended for employees or users who require advanced configuration permissions. It includes permissions for all custom data and feature configurations owned by CXG.

Procedure

  1. On the Salesforce Platform, go to Setup > Users and select the employee account that will manage the WeChat integration.

  2. Find Permission Set Group Assignments and click Edit Assignments.

  3. In Available Permission Set Groups, select the CXG Admin permission set group.

  4. Click Add, and then click Save.

Grant CXG WeChat Agent permissions

The CXG WeChat Agent permission set group is intended for customer service agents or employees who require view permissions for CXG-related custom data objects and operational permissions for the WeChat chat widget.

Procedure

  1. On the Salesforce Platform, go to Setup > Users and select the employee account that needs to use the WeChat chat widget.

  2. Find Permission Set Group Assignments and click Edit Assignments.

  3. In Available Permission Set Groups, select the CXG WeChat Agent permission set group.

  4. Click Add, and then click Save.

Grant users Connected App permissions

You can set an Assigned Connected App in a Permission Set. However, a Permission Set that contains a first-generation package (1GP) Connected App cannot be packaged. Therefore, the administrator must manually create a Permission Set that includes permissions to access and use the CXG Connected App. You must then assign this permission set to employees who need to use the CXG Connected App features.

Procedure

  1. On the Salesforce Platform, go to Setup > Permission Sets and click New.

    • For Label, enter a name for the Permission Set. We recommend using `CXG Canvas App Assignment`.

    • Set License to None.

  2. Save the settings. You are redirected to the permission set details page.

  3. Click Assigned Connected App > Edit, select CXG_CANVAS, and then click Save.

  4. Click Manage Assignment > Add Assignment. Select all users who need to access the Connected App, including but not limited to the following:

    • Integration User (CXG Automated)

    • CXG Admin

    • CXG WeChat Agent

  5. Click Save to complete the process.

Configure the Connected App

A Connected App is a framework that allows external applications to integrate with the Salesforce Platform by calling APIs and setting standard protocols. For more information, see What is a Connected App?. CXG uses a Connected App to implement the customer service messaging feature and operate related data objects. Before you begin, you must configure the OAuth authorization method, API call integration user, and permission sets for the CXG Connected App.

This topic describes how to configure the Connected App.

Prerequisites

  1. The Connected App is added to the Salesforce Platform after the package is installed.

  2. An integration user is created.

  3. All permission-related configurations are complete.

Procedure

  1. Log on to the Salesforce Platform, click Setup, and search for App Manager.

  2. Find CXG_CANVAS and click Manage in the operations column.

  3. Click Edit Policies. Under OAuth Policies, for Permitted Users, select Admin approved users are pre-authorized.

  4. Under Client Credentials Flow, for Run As, search for and select CXG Automated.

  5. Click Save to complete the process.

Note: Selecting Admin approved users are pre-authorized for OAuth Policies is an important security measure for the CXG Connected App. After you update to the Admin-approved mode, we recommend that you do not change this setting again.

Configure the chat widget

The customer service chat tool is provided as a Lightning component. An administrator must drag the chat widget to the target page. Then, agents can use the CXG chat widget to have one-on-one conversations with end users from channels such as WeChat Official Accounts. You can also combine this with the rich features in Salesforce Service Cloud, such as Case management, to provide better customer service to end users.

Note:

  • **In CXG version 24.10, you can have one-on-one conversations using the chat widget on the Messaging Session custom object details page. We recommend that agents use Messaging Session for all customer service work and use Case as a secondary object to track customer tickets. This topic describes how to configure the chat widget.

Prerequisites

The Connected App is added to the Salesforce Platform after the CXG Package is installed.

Procedure

Note: If you want to use Messaging Session as the core object for customer service chats and Case only as a secondary object, you can skip the following steps. Instead, see Configure the Messaging Session Record Page and WeChat chat widget.

  1. Log on to the Salesforce Platform and click Setup > Object Manager.

  2. Search for Case. Click Case > Lightning Record Pages. Select the Case Record Page where you want to add the CXG chat widget. You can use a Case Record Page that is already applied to the Salesforce Service Console, or you can create a new Case Record Page to apply to another target app. The following steps use a new Case Record Page as an example.

  3. Click New and select Record Page.

  4. Click Next and enter the following information:

    • a. Label: CXG Case Record Page

    • b. Object: Case

  5. Click Next and select a Page Template. We recommend that you select Three Regions.

  6. Click Done. You are redirected to the Lightning App Builder. Start to configure the page components.

    • a. Drag the Related Record component to the left column to display Case Details.

    • b. Drag the Related Record component to the left column. In the settings pane on the right, select Contact Name for the Lookup Field to display Contact Details.

    • c. Drag the Highlights Panel component to the middle column.

    • d. Drag the Tab component to the middle column. In the settings pane on the right, change the tab names to Details, CXG Conversation, and Feed.

      • i. Drag the Record Detail component to the Details tab.

      • ii. Drag the CXG Conversation component to the CXG Conversation tab. (The CXG_CHAT component will be unpublished in version 24.09. To ensure normal functionality, switch to the CXG Conversation component as soon as possible.)

      • iii. Drag the Chatter Feed component to the Feed tab.

    • e. Drag the Tab component to the right column. In the settings pane on the right, change the tab name to Related.

      • i. Drag the Related List component to the Related tab.

    • f. Click the Record Detail component. In the settings pane on the right, click the Case Layout that is in use.

    • g. You are redirected to the Case Page Layouts settings page. In the scroll bar in the upper-right corner, find Related Lists and drag MessagingSessions to the area below. Click Save.

  7. Return to the Lightning App Builder. After you confirm that all components are configured, click Save in the upper-right corner.

  8. Click Activate. Activation is the process of configuring access permissions for the Record Page. This process determines whether the Record Page can be accessed by the entire organization, by a specific app, or only by certain people. In the upper-right corner, click Activation and select Org Default, App Default, or App, Record Type, and Profile. Set the conditions as needed. We recommend that you select App Default and apply it to the Service Console.

  9. After you complete the activation settings, click Save. The process is complete.

Note:

  • The chat widget's chat feature is not yet active because the configuration process is not complete. This is expected behavior.

  • We recommend that you drag the chat widget to the widest available column to ensure there is enough space for the chat window.

  • The Connected App hosted by the chat widget has its own permissions. Users who do not have permission to access the CXG Connected App cannot access the chat widget, even if they have permission to view the Case Record Page.

Configure data objects

CXG stores data from social accounts, such as WeChat Official Accounts, WeChat Mini Programs, and WeCom, in the Salesforce Platform. This data includes account, user, and chat information. You can use the relationships between data objects and the rich product features in Salesforce to flexibly use this data and create higher business value.

We created the following six custom objects to store WeChat-related data:

  • MessagingChannel__c: Message channel

  • MessagingEndUser__c: End user

  • MessagingSession__c: Session

  • Conversation__c: Chat (currently has a one-to-one relationship with MessagingSession__c)

  • ConversationEntry__c: Chat message. Administrators must configure the Lightning Record Page and Page Layout for custom objects to display object data. They must also configure the chat widget in the Record Page to display session history.

  • The fields of the preceding objects are maintained by CXG. If you develop on this content, attach a flow, or change fields, note the following:

    • When you add a new custom field to these objects, do not make it a required field. CXG cannot detect this extra field, which will cause missing field errors.

    • If you configure a record-triggered flow, configure it to run asynchronously. This prevents exceptions when CXG maintains the object if the flow fails to execute.

This topic describes how to configure the page display for custom objects.

Prerequisites

  1. After the package is installed, the custom objects are added to the Salesforce Object Manager.

  2. After the package is installed, each custom object automatically has a corresponding Page Layout.

Note: Among the five custom objects, only MessagingSession__c and MessagingEndUser__c require Page Layout configuration. You can configure the other objects in the same way for data display purposes, but this configuration does not affect the actual business process.

Configure the Messaging Session Record Page and WeChat chat widget

Procedure

  1. Log on to the Salesforce Platform and click Setup > Object Manager.

  2. Click the Messaging Session custom object > Lightning Record Pages.

  3. Click New and select Record Page.

  4. Click Next and enter the following information:

    • a. Label: CXG Messaging Session Record Page

    • b. Object: Messaging Session custom object

  5. Click Next and select a Page Template. We recommend that you select Header and Right Sidebar.

  6. Click Done. You are redirected to the Lightning App Builder. Start to configure the page components.

    • a. Drag the Highlights Panel component to the top bar.

    • b. Drag the Tab component to the middle column. In the settings pane on the right, change the tab names to CXG Conversation and Details.

      • i. Drag the CXG Conversation component to the CXG Conversation tab. (The CXG_CHAT component will be unpublished in version 24.09. To ensure normal functionality, switch to the CXG Conversation component as soon as possible.)

      • ii. Drag the Record Detail component to the Details tab.

    • c. Drag the Related Record component to the right column. In the settings pane on the right, select CaseId for the Lookup Field to display Case Details.

    • d. Drag the Related Record component to the right column. In the settings pane on the right, select MessagingEndUserId for the Lookup Field to display Messaging End User Details. (This step requires you to configure an Update Action. If you do not have one, skip this step.)

    • e. Drag the Related Record component to the left column. In the settings pane on the right, select MessagingEndUserId for First look up and ContactId for Second look up. This displays Contact Details.

  7. Click the Details component. In the settings pane on the right, click the Messaging Session Layout that is in use.

  8. You are redirected to the Messaging Session Page Layouts settings page. In the scroll bar in the upper-right corner, find Fields. Drag more fields to the area below to display more information. Click Save.

  9. Return to the Lightning App Builder. After you confirm that all components are configured, click Save in the upper-right corner.

  10. Click Activate. Activation is the process of configuring access permissions for the Record Page. This process determines whether the Record Page can be accessed by the entire organization, by a specific app, or only by certain people. In the upper-right corner, click Activation and select Org Default, App Default, or App, Record Type, and Profile. Set the conditions as needed. We recommend that you select App Default and apply it to the Service Console.

  11. After you complete the activation settings, click Save.

  12. The process is complete.

Configure the Messaging End User Record Page

Procedure

  1. Log on to the Salesforce Platform and click Setup > Object Manager.

  2. Click the Messaging End User custom object > Lightning Record Pages.

  3. Click New and select Record Page.

  4. Click Next and enter the following information:

    • a. Label: CXG Messaging End User Record Page

    • b. Object: Messaging End User custom object

  5. Click Next and select a Page Template. We recommend that you select Header and One Region.

  6. Click Done. You are redirected to the Lightning App Builder. Start to configure the page components.

    • a. Drag the Highlights Panel component to the top bar.

    • b. Drag the Tab component to the bottom bar.

      • i. Drag the Related List component to the Related tab.

      • ii. Drag the Record Detail component to the Details tab.

  7. Click the Details component. In the settings pane on the right, click the MessagingEndUser Layout that is in use.

  8. You are redirected to the MessagingEndUser Page Layouts settings page. In the scroll bar in the upper-right corner, find Fields. Drag more fields to the area below to display more information.

  9. In the scroll bar in the upper-right corner, find Related Lists and drag MessagingSessions to the area below. Click Save.

  10. Return to the Lightning App Builder. After you confirm that all components are configured, click Save in the upper-right corner.

  11. Click Activate. Activation is the process of configuring access permissions for the Record Page. This process determines whether the Record Page can be accessed by the entire organization, by a specific app, or only by certain people. In the upper-right corner, click Activation and select Org Default, App Default, or App, Record Type, and Profile. Set the conditions as needed. We recommend that you select App Default and apply it to the Service Console.

  12. After you complete the activation settings, click Save.

  13. The process is complete.

Add custom object tabs

After you configure the Record Pages, you must add tabs to display the custom object lists in your Salesforce app.

Procedure

  1. Log on to the Salesforce Platform.

  2. Go to the Service Console or another target app and click Edit in the navigation bar.

  3. Click Add More Items and add the custom tabs you just created: Messaging Session and Messaging End User.

  4. The process is complete.

Configure quick text replies

The chat widget supports the standard Quick Text object to help agents send quick replies. To enable this feature, you must create a dedicated channel for CXG in Quick Text and enter the quick text content into that channel.

You must complete the following steps to use the quick text reply feature.

Procedure

  1. Log on to the Salesforce Platform.

  2. Go to Setup > Object Manager, search for Quick Text, and click it.

  3. Click Fields & Relationships > Channel > Channel Picklist Values.

  4. Under Picklist Values, click New. Add Social Chat (the name must be an exact match). Click Save.

  5. Click the App Launcher, search for Quick Text, and click it.

  6. Click New Quick Text. For Channel, select Social Chat. Create the first quick text for the CXG chat widget.

  7. The process is complete.

Authorize a WeChat Official Account or WeChat Mini Program account

  • Authorizing a WeChat Official Account allows CXG to retrieve WeChat follower data and enables the customer service messaging feature. When a follower sends a message to the Official Account, an agent can have a one-on-one conversation with the follower on the Salesforce Platform.

  • Authorizing a WeChat Mini Program allows CXG to retrieve WeChat Mini Program user data and enables the customer service messaging feature. When a user sends a message to the Mini Program, an agent can have a one-on-one conversation with the user on the Salesforce Platform. Note that in the WeChat Mini Program admin console, the Receive and send messages in the official customer service console option under Basic Features > Customer Service > Mini Program Customer Service must be turned off.

Note: To ensure a good end-user experience, we recommend that you do not authorize a production WeChat Official Account or Mini Program in a Sandbox staging environment for testing.

Prerequisites

  1. You have registered for the WeChat Official Account and WeChat Mini Program accounts that you want to authorize in CXG.

  2. The Official Account to be authorized must be verified by WeChat to obtain API access.

Procedure

WeChat Official Account

  1. Log on to Salesforce. Search for and switch to the CXG app. Click Settings > Connector.

  2. Click Connect Official Account.

  3. The Official Account administrator scans the QR code and confirms the authorization to CXG on their mobile phone.

  4. Done.

WeChat Mini Program

  1. Log on to Salesforce. Search for and switch to the CXG app. Click Settings > Connector.

  2. Click Connect Mini Program.

  3. The Mini Program administrator scans the QR code and confirms the authorization to CXG on their mobile phone.

  4. Done.

Note: To avoid issues with API calls or integration features, we recommend that you use a verified Official Account or Mini Program for authorization.

Unauthorize a WeChat Official Account or WeChat Mini Program account

  • You can unauthorize an account by deleting the WeChat Official Account or WeChat Mini Program connector. After you delete the connector, you can add it to another Salesforce organization.

  • Deleting the WeChat Official Account or Mini Program connector does not delete other Salesforce data.

  • Perform this operation only when you need to delete a WeChat Official Account or Mini Program connector.

  • Deleting the WeChat Official Account or Mini Program connector does not unauthorize the account from the WeChat third-party platform. To completely unauthorize the account, the Official Account administrator must go to Settings > Third-party Settings > Authorization Management in the WeChat Admin Platform and remove the authorization.