当前位置:网站首页>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
边栏推荐
- Development prospect and investment strategic planning report of global and Chinese PVC hose industry from 2022 to 2028
- Oracle 数据泵导表
- 钉钉开放平台-小程序开发实战(钉钉小程序客户端)
- Zeromq from getting started to mastering
- How does virtual box virtual machine software accelerate the network speed in the virtual system?
- Conditional variables for thread synchronization
- But the Internet began to have a new evolution and began to appear in a new state
- mysql自帶的性能測試工具mysqlslap執行壓力測試
- Solution to composer error could not find package
- Report on demand situation and development trend of China's OTC industry from 2022 to 2028
猜你喜欢

Detailed explanation of globalkey of flutter

Part 4: drawing quadrilateral
![ctf [RoarCTF 2019]easy_ calc](/img/c7/16adb8e4b64a4be2129a6c53c5aaa7.jpg)
ctf [RoarCTF 2019]easy_ calc

Understand CGI and fastcgi

Detr3d multi 2D picture 3D detection framework

【QT】资源文件导入

MySQL index details

Double buffer technology asynchronous log system

Nailing open platform - applet development practice (nailing applet client)

2021 year end summary
随机推荐
Part 4: drawing quadrilateral
软件调试测试的十大重要基本准则
Getter actual combat geTx tool class encapsulation -getutils
钉钉开放平台-小程序开发实战(钉钉小程序服务器端)
Ipvs0 network card of IPVS
Ubuntu installs PostgreSQL and uses omnidb to view
Which is the best embedded visual programming software? (introduction, evaluation and selection of visual programming platform) [scratch, mind+, mixly]
Mutex of thread synchronization (mutex)
Chrome page recording and playback function
Go SQL parsing time Time type
2021 year end summary
Read / write lock for thread synchronization
Knowledge about SQL - DML
In 2022, what professional competitions can college students majoring in automation, electrical engineering and automation participate in?
Using jsup to extract images from interfaces
In the matter of getting customers at sea, how can advertisers play besides digital advertising?
Knowledge of SQL - database design, backup and restore
Sorting out the knowledge points of the renderview renderobject parentdata of the shuttle
Tp6 multi table Association (table a is associated with table B, table B is associated with table C, and table d)
C generic