Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example Analysis of multiple customer Service developed by Wechat Public platform

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Xiaobian to share with you the WeChat public platform development of many customer service example analysis, I hope you read this article after some gains, let us discuss it together!

I. Reply to multiple customer service messages

In the new WeChat protocol, development mode can also be connected to customer service system. If the developer needs to let the user use the customer service system, it needs to return a message with MsgType of transfer_customer_service when receiving the message sent by the user. When the WeChat server receives this message, it will forward the message sent by the user this time and the message sent in the future.

Examples of returned messages are as follows

1399197672

The message is implemented as follows

//Reply to multiple customer service messages private function transmitService($object) { $xmlTpl = "%s"; $result = sprintf($xmlTpl, $object->FromUserName, $object->ToUserName, time()); return $result; }

II. Trigger multi-customer service sessions

In general, users want to consult questions, often ask "hello,""where," such questions.

We use these words as trigger keywords. When the text message content sent by the user contains these words, we will return a multi-customer service message to the user (the user does not feel any content on the WeChat end, but the WeChat public account will forward the user's messages this time and for a period of time to the customer service).

The implementation code is as follows:

//Receive text messages private function receiveText($object) { $keyword = trim($object->Content); if (strstr($keyword, "complaint")|| strstr($keyword, "Hello")|| strstr($keyword, "is there")){ $result = $this->transmitService($object); } return $result; }

III. Complete code

IV. Other matters needing attention

1. After testing, the multi-customer service message is returned in the custom menu, and the user cannot enter the multi-customer service state.

2. After using multiple customer service messages, all subsequent messages will be forwarded as customer service messages for a period of time, and the automatic reply in the original development mode will be invalid!!!

After reading this article, I believe you have a certain understanding of the "sample analysis of WeChat public platform development and customer service". If you want to know more relevant knowledge, you are welcome to pay attention to the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report