找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索本站精品资源

首页 教程频道 小程序开发 查看内容

微信小程序客服消息模块

作者:模板之家 2018-5-4 15:53 1301人关注

发送文字消息 $type = text; // 可选参数,text,link,image,miniprogrampage$kefu = new \Com\Kefu($type,$token); //群发消息一般都是群发一种类型的消息的,所以将type加载到构造中$data = array( touser=xxxxx, t ...

发送文字消息

$type = 'text'; // 可选参数,text,link,image,miniprogrampage
$kefu = new \Com\Kefu($type,$token); //群发消息一般都是群发一种类型的消息的,所以将type加载到构造中
$data = array(
    'touser'=>'xxxxx',
    'text'=>'您好'
)
$kefu->set($data);
$kefu->run();发送图片消息
$type = 'image'; // 可选参数,text,link,image,miniprogrampage
$kefu = new \Com\Kefu($type,$token); //群发消息一般都是群发一种类型的消息的,所以将type加载到构造中
$data = array(
    'touser'=>'xxxxx',
    'media_id'=>'media_id'
)
$kefu->set($data);
$kefu->run();发送图文消息
$type = 'link'; // 可选参数,text,link,image,miniprogrampage
$kefu = new \Com\Kefu($type,$token); //群发消息一般都是群发一种类型的消息的,所以将type加载到构造中
$data = array(
    'touser'=>'xxxxx',
    'title'=>'你好',
    'description'=>'今天的天气不错',
    'url'=>'https://wwww.xxx.xxx',
    'thumb_url'=>'thumb_image_url'
)
$kefu->set($data);
$kefu->run();
发送小程序卡片
$type = 'miniprogrampage'; // 可选参数,text,link,image,miniprogrampage
$kefu = new \Com\Kefu($type,$token); //群发消息一般都是群发一种类型的消息的,所以将type加载到构造中
$data = array(
    'touser'=>'xxxxx',
    'title'=>'xxx小程序',
    'pagepath'=>'/pages/index',
    'thumb_media_id'=>'thumb_media_id',
)
$kefu->set($data);
$kefu->run();

路过

雷人

握手

鲜花

鸡蛋
原作者: 模板之家 来自: 网络收集

全部回复(0)