天天看點

微信公衆号開發-對指定使用者發送客服消息流程代碼

流程

擷取到使用者openid 調用api就可發送消息

代碼

消息發送頁面

<?php
    include './wxz.php';

    if($_POST['msg']){
        $openid = $_POST['openid'];
        $msg = $_POST['msg'];
        (new Wxz())->kefuMsg($openid, $msg);
    }
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>客服消息</title>
</head>
<body>
    <form action="" method="post">
        <input type="text" name="openid" value="oLSiH5oWuR5RrpJ5P64sOqrsHRtU" id="">
        <input type="text" name="msg" id="">
        <input type="submit" value="發送消息">
    </form>
</body>
</html>
           

db.php 與 wxz.php 見

https://blog.csdn.net/weixin_42043407/article/details/116905422

https://blog.csdn.net/weixin_42043407/article/details/116905455

繼續閱讀