WeChat is one of biggest messaging platforms next to Facebook Messenger. WeChat has been using chatbots way back in 2013 when most didn’t know about chatbots! The staggering part is that traditional feed-based social media has evolved into messaging platforms in China long before it entered the U.S. market. Now WeChat is the dominant social media platform in China where it’s used for content marketing, shopping, customer service, and transaction.

There are two kinds of official accounts in WeChat China which you can use to create chatbots: subscription accounts and service accounts. You can be either as a Chinese or foreign entity to apply for an account, of course, there are third-party services to help you do this. WeChat maintains strict requirements on who can get a public account. The process can range from a few weeks to months. This is only done to ensure the best experience for its users.

In this post, I am going to show how to quickly build a customer support bot in WeChat. Let’s call it “Weixin” customer support bot. I am going to use smartloop.ai to build it out. Here the simple scenario is that someone is trying to learn more about your service and you want them to reach out to you directly via email to connect. (In the next post, I am going show how to do the same using live person takeover).

The first step is to create the bot. You can easily create one by going to dashboard.smartloop.ai. In the “Create a Chatbot” popup be sure to select Chinese as the main language. This will scaffold a basic bot with all the required blocks. We will modify it to create a contact flow. When the first time someone follows your bot, it will be the start block to send the first message. Make sure to add enough information about your bot’s functionality and instructions what to do next.

Smartloop Conversation Builder

In the “start” block and to make it very simple, I will ask the user if they want to reach out to the support team. If they say “yes” then it will take the user through an email flow and finally notify using an email service.

User Input Plugin

Here I am asking if the user wants to contact the support followed by required yes/no (要/不要) input. On successful validation, I am storing it in a user variable.

As the user says “yes”, I am taking them to the “contact” block as shown below:

Go to Plugin

For user says “不要”, finish the conversation with an exit message as shown below:

Exit message

Now in the contact block, first ask the user for her email:

Email Prompt

Validate and capture the input using an input plugin as shown below:

User Input Plugin

Next, ask “Please tell us, how can we help?” This will go in the body of the email

Store it in a user variable using the input plugin as shown below:

User Input Plugin

Finally, send out the notification email. Here, I’ve used SendGrid, add a JSON API Plugin and configure it as shown below:

JSON API Plugin

Get a free key from SendGrid. Once you have it, paste into the headers section of JSON API plugin:

{

"Authorization": "Bearer PASTE_YOUR_SENGRID_API_SECRET"

}

Next, copy and paste the following to the body of the plugin with the email and desc captured via user input (checkout SendGrid for more on how to construct the email body):



"personalizations": [

{

"to": [

{

"email": "

}

],

"subject": "Requested Support for Weixin Bot"

}

],

"from": {

"email": "{{email}}"

},

"content": [

{

"type": "text/html",

"value": "{{desc}}"

}

]

} "personalizations": ["to": ["email": " hello@recime.io ],"subject": "Requested Support for Weixin Bot"],"from": {"email": "{{email}}"},"content": ["type": "text/html","value": "{{desc}}"

Finally, complete the flow with an exit message, “Thank you for reaching out! Someone on our support team will be in touch soon.” :

Text Block

Once completed, make sure everything is working as expected by trying the bot out in the simulator before going to the next step:

Smartloop Conversation Builder

Although we designed the flow to get a user to a contact flow, we should also give user a way to ask for help directly. Click on the Expressions tab and add “救命” and “help” and a few others as an utterance. This is training your chatbot to understand when a user asks for help.

Define Expressions

Press “Train” to build the bot.

WeChat provides a sandbox environment that makes it easy to test your chatbot on a live public account. Follow the instructions to get your sandbox credentials. Copy the appId and, then go to “Configure” tab from the left navigation bar and update the configuration as shown below:

Go to your WeChat sandbox dashboard and scan the QR Code with your WeChat app to start chatting with the bot. The sandbox has a daily rate limit, however, it’s good for testing the chatbot and allows you to experience the chatbot as it would be on a real public account.

This was a quick example of how to get your WeChat bot up and running quickly and easily. You can easily add other content and integrations to the chatbot. A more advanced support chatbot can have different flows based on topics and direct to different support agents. In a later example, we’ll show you how to add live agent support.

If you would like to learn more then reach out to us at hello@smartloop.ai.

You can sign up for free to start building your automated agents today! Please don’t forget to clap and give us feedback to improve.