In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how php realizes multi-customer service system in the development mode of Wechat public platform". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how php implements multi-customer service system in Wechat public platform development model".
1. Reply to multiple customer service messages
In the new Wechat agreement, the development mode can also be connected to the customer service system. If a developer needs to let a user use the customer service system, he needs to return a message with a MsgType of transfer_customer_service when he receives the message sent by the user. When receiving this message, the Wechat server will forward the message sent by the user this time and within a period of time to the customer service system.
Examples of messages returned are as follows
1399197672
The implementation of this message is as follows (based on the Wechat public platform PHP SDK of Fangbi Studio)
/ reply to multi-customer service message private function transmitService ($object) {$xmlTpl = "% s"; $result = sprintf ($xmlTpl, $object- > FromUserName, $object- > ToUserName, time ()); return $result;}
Second, trigger multi-customer service conversation
In general, when users want to ask questions, they often ask questions like "Hello" and "Hello".
We use these words as trigger keywords, and when the text message sent by the user contains these words, a multi-customer service message is returned to the user (the user does not feel any content on Wechat. However, the Wechat public account will forward the user's messages to customer service this and for some time to come).
The implementation code is as follows:
/ / receive text message private function receiveText ($object) {$keyword = trim ($object- > Content); if (strstr ($keyword, "complaint") | | strstr ($keyword, "Hello") | | strstr ($keyword, "Hello") {$result = $this- > transmitService ($object);} return $result;}
III. Complete code
This code has been tested and returns multiple customer service messages in the custom menu, which cannot allow users to enter the multi-customer service status. after using multiple customer service messages, all subsequent messages will be forwarded as customer service messages within a period of time. The automatic reply in the original development mode will be invalidated.
Thank you for reading, the above is "how php in the Wechat public platform development model to achieve multi-customer service system" content, after the study of this article, I believe you have a deeper understanding of how php in the Wechat public platform development model to achieve multi-customer service system this problem, the specific use still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.