Commit 99ad6119 authored by 梁俊杰's avatar 梁俊杰

1

parent 6e286fed
......@@ -40,15 +40,10 @@ if(isset($users[$data['assignedTo']])){
$req->setAppkey($config['app_key']);
$req->setAppsecret($config['app_secret']);
$res = $c->execute($req,null,'https://oapi.dingtalk.com/gettoken');
$token = $res->access_token;
$token = $res->access_token;
$message = '{"msgtype":"markdown","markdown":{"text":"'.$data['markdown']['text'].'"}}';
$req = new OapiMessageCorpconversationAsyncsendV2Request();
$req->setAgentId('326099394');
$req->setToAllUser(false);
$req->setUseridList($users[$data['assignedTo']]['userid']);
$req->setMsg($message);
$url = 'https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2?access_token='.$token;
$res = $c->curl($url, ['agent_id' => '326099394', 'userid_list' => $users[$data['assignedTo']]['userid'], 'msg' => $message]);
$f = fopen("./txt/test.txt", "a");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment