当前位置:网站首页>Notes on enterprise wechat development [original]
Notes on enterprise wechat development [original]
2022-06-26 04:19:00 【Telkobe】
Because the company needs , When someone submits a new task, it is necessary to timely notify the relevant personnel to handle it , However, the effect of messages on the site is not very ideal , People need to be in front of the computer to know whether there is a new task , Others are emails , SMS can also achieve the effect of similar notification , But if the news is more frequent, it doesn't feel appropriate , Therefore, it is finally considered to implement on wechat
At first, I wanted to push relevant messages through wechat official account , Later, I found that there was a time limit for customer service messages , It's usually 48 Within hours , If the user does not have necessary interaction with the official account during this period , that 48 After hours, the server cannot actively push the customer service message to the specified user . The template Message requirements are also very strict , Only official approved templates can be used , It's hard to find the perfect template for your business , And template messages should not be pushed too frequently , Official examples ( The sending frequency of template message cannot be too high to disturb the receiver example : A user clicks on the custom menu of the official account once or other triggering operations , The continuous received 3 Or more duplicate template messages , It's a violation ), Anyway, it is still a bit risky to push the template messages of official account as daily work messages , Maybe it will be banned one day . Finally, I found a good thing , Enterprise WeChat , Enterprise wechat has the same functions as official account , Push messages include , Web authorization, etc , So we quickly transplanted the relevant configurations of enterprise wechat to the previously developed official account code .
The core of the whole program is to use Easywechat, This thing is still very easy to use , Encapsulate some disgusting aspects of wechat development at ordinary times , Users basically only need to care about the business layer , Very efficient development . Here is a basic code ( Copy and paste official documents ).
$config = [
'corp_id' => 'xxxxxxxxxxxxxxxxx',
'agent_id' => 100022,
'secret' => 'xxxxxxxxxx',
// server config
'token' => 'xxxxxxxxx',
'aes_key' => 'xxxxxxxxxxxxxxxxxx',
//...];
$app = Factory::work($config);
$app->server->push(function(){
return 'Hello easywechat.';}
);
$response = $app->server->serve();$response->send();
This code consists of a simple enterprise wechat server
corp_id: Enterprise WeChat ID, Log in to the official website of enterprise wechat and click my enterprise , The bottom is .
agent_id: Self built application ID
secret: Self built application secret.
Self built applications are a core thing , It is responsible for pushing the following messages . Click on Application Management , Click Create Application in self build .
Set applied logo And name these , All custom , very nice
After the creation, you can get the application ID and secret 了 . Find the receiving message module , Set the message server configuration , It is similar to the server configuration of wechat official account , You need to set up your own server in advance , Submit the code to the server and then do this step , Because the configuration server url Wechat will check the address , If you access this url Failed to return the value to wechat server , Then it will prompt failure .
In this step, we get token and aes_key. Everything required for the configuration items in this code has been provided .
Click to the bottom of the application details to find these two things , Web page authorization and enterprise wechat authorization , Then configure the domain name , And the previous server configuration url Same domain name , This is mainly used for web page authorization to obtain user information .
That's all for the basic steps
边栏推荐
- VHDL设计
- Mysql8.0 configuring my SQL in INI file_ mode=NO_ AUTO_ CREATE_ User can start
- Syntax error of go language generic in IDE
- Database related knowledge
- Implementation of seven classes of BlockingQueue interface
- Clickhouse stand alone installation
- Yolov5 improvements: replace the backbone
- Getting started with flask
- Go SQL parsing time Time type
- Video label forbids downloading. The test is valid. Hide button. The test is valid at three points
猜你喜欢
Threejs专用天空盒素材,五种天空盒素材免费下载
小程序中实现视频通话及互动直播功能
[Qunhui] no port access (reverse proxy + intranet penetration)
Capture packets (Wireshark)
Minecraft 1.16.5 生化8 模组 1.9版本 1.18版本同步
MapReduce execution principle record
A brain map to summarize the needs analysis (a supplement to the actual situation at work)
[Qunhui] Internet access + custom port
线程同步之条件变量
The open software of win10 system is too small. How to make it larger (effective through personal test)
随机推荐
CTF PHP audit bypasses filtering learning from topics
Threejs special sky box materials, five kinds of sky box materials are downloaded for free
Analysis report on development trend and market demand of global and Chinese molecular diagnostics industry from 2022 to 2028
Detailed explanation of globalkey of flutter
Group by and order by are used together
Conditional variables for thread synchronization
Development prospect and investment strategic planning report of global and Chinese PVC hose industry from 2022 to 2028
Principle and implementation of syn cookie
SQL related knowledge - DQL
钉钉开放平台-小程序开发实战(钉钉小程序客户端)
Verrouillage de lecture et d'écriture pour la synchronisation des fils
Swagger
C generic
English version of ternary loss
win10 系统打开的软件太小,如何变大(亲测有效)
What should I do if the 51 SCM board cannot find the device in keil
Sorting out the knowledge points of the renderview renderobject parentdata of the shuttle
NFT creation and binding of BSC and HT chains
What preparations should be made to develop an app from scratch
Redis cache data consistency solution analysis