当前位置:网站首页>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
边栏推荐
- Report on operation mode and future development trend of China's refining and chemical market 2022-2028
- Threejs专用天空盒素材,五种天空盒素材免费下载
- 2021 year end summary
- Parse JSON interface and insert it into the database in batch
- 六、项目实战---识别猫和狗
- List of provinces, cities and counties in China
- The stc-isp burning program for 51 single chip microcomputer always shows that "the target single chip microcomputer is being detected..." the cold start board does not respond
- OSS CDN alicloud configuration method
- Wechat applet is bound to a dynamic array to implement a custom radio box (after clicking the button, disable the button and enable other buttons)
- R language and machine learning
猜你喜欢

Judge the same value of two sets 𞓜 different values

35岁程序员炒Luna 千万资产3天归零,网友:和赌博一样

After a test of 25K bytes, I really saw the basic ceiling

35 year old programmer fired Luna millions of assets and returned to zero in three days. Netizen: it's the same as gambling
![[Nuggets' operation routine disclosure] the routine of being truly Nuggets](/img/42/b4004579fc89f7efcb6b4a4bc7e389.png)
[Nuggets' operation routine disclosure] the routine of being truly Nuggets

Oracle technology sharing Oracle 19.14 upgrade 19.15

win10 系统打开的软件太小,如何变大(亲测有效)

Install dbeaver and connect Clickhouse

Tp6 controller does not exist: app\index\controller\index

钉钉开放平台-小程序开发实战(钉钉小程序服务器端)
随机推荐
钉钉开放平台-小程序开发实战(钉钉小程序服务器端)
钉钉开放平台-小程序开发实战(钉钉小程序客户端)
Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优
China air compressor manufacturing market demand analysis and investment prospect research report 2022-2028
微软禁止俄用户下载安装Win10/11
After four years of outsourcing, people are directly abandoned...
WPF 值转换
MySQL index details
Report on demand situation and development trend of China's OTC industry from 2022 to 2028
使用Jsoup提取接口中的图片
Use soapUI to access the corresponding ESB project
CDN with OSS acceleration
Unity mobile game performance optimization spectrum CPU time-consuming optimization divided by engine modules
College C language final exam · multiple choice questions · summary notes of mistakes and difficulties
6、 Project practice --- identifying cats and dogs
[Qunhui] import certificate
Knowledge of SQL - database design, backup and restore
NPM installation tutorial
Threejs专用天空盒素材,五种天空盒素材免费下载
ctf [RoarCTF 2019]easy_ calc