GithubHelp home page GithubHelp logo

lishengli6846 / weapp-kefu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nagill/weapp-kefu

0.0 2.0 0.0 3 KB

微信小程序客服消息模块,基于驱动开发,支持所有的客服消息的发送

PHP 100.00%

weapp-kefu's Introduction

weapp-kefu

微信小程序客服消息模块,基于驱动开发,可以有效解决群发消息的问题,单个类型的消息独立不干扰

发送文字消息

$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();

weapp-kefu's People

Contributors

nagill avatar namestc avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.