【微信公众号开发】自我学习第九章:消息模板
来源:互联网 发布:同知 编辑:程序博客网 时间:2024/06/05 07:26
每个模板都需要是申请的,最多能够申请15个
一个账号的当日的模板消息次数不能超过10w次
我们测试的模板最多只能是10个
- 设置所属行业
$url = 'https://api.weixin.qq.com/cgi-bin/template/api_set_industry?access_token='.$token;$data = array( 'industry_id1' => 1, 'industry_id2' => 3,);$configData = urldecode(json_encode($data));$data = $this->curl_http($url, 'post', 'json', $configData);dump($data);die;
//返回值array:2 [▼ "errcode" => 0 "errmsg" => "ok"]
- 获取所属行业
$url = 'https://api.weixin.qq.com/cgi-bin/template/get_industry?access_token='.$token;$configData = urldecode(json_encode($data));$data = $this->curl_http($url, 'post', 'json', $configData);dump($data);die;
//返回值array:2 [▼ "primary_industry" => array:2 [▼ "first_class" => "IT科技" "second_class" => "互联网|电子商务" ] "secondary_industry" => array:2 [▼ "first_class" => "IT科技" "second_class" => "IT硬件与设备" ]]
- 发送模板消息
模板消息:
(。・∀・)ノ゙嗨您好!欢迎关注{{name.DATA}} ,现在是{{time.DATA}}!鸡年大吉吧!
$url = 'https://api.weixin.qq.com/cgi-bin/message/template/send?access_token='.$token;$data = array( 'touser' => 'oopkWt83CVPKJ6t08PAfr0ZSRWSw', 'template_id' => 'Jyk5Oy8sVynsaMm23uyvdcM738KCFh3mlZskZEKQSPM', 'url' => '',// 'miniprogram' => array(// "appid" => "wx8a8b6e4cdb4bdd1c",// "pagepath" => "index?foo=bar"//// ), 'data' => array( 'name' => array( "value" => "终南山一霸", "color" => "#173177" ), 'time' => array( "value" => urlencode(date_format(new \DateTime(),'Y-m-d h:m:s')), "color" => "#173177" ) ),);$configData = urldecode(json_encode($data));$data = $this->curl_http($url, 'post', 'json', $configData);dump($data);die;
阅读全文
1 0
- 【微信公众号开发】自我学习第九章:消息模板
- 【微信公众号开发】自我学习第四章:消息回复之翻译回复
- 微信公众号开发--模板消息
- 【微信公众号开发】自我学习第三章:消息回复之文本回复和图文回复
- 【微信公众号开发】自我学习第七章:公众号自定义菜单栏
- 【微信公众号开发】自我学习第六章:微信回复天气问题
- .net微信公众号开发——模板消息
- 微信公众号开发之[发送模板消息]
- 微信公众号开发——模板消息
- node js 微信公众号,模板消息开发测试
- 微信公众号开发之模板消息
- 微信公众号开发---模板消息url
- 微信公众号开发---消息模板的使用
- 微信公众号开发(十)模板消息
- 微信公众号开发(四)推送消息模板
- 微信公众号开发-----微信模板消息接口-----发送模板消息
- 【微信公众号开发】自我学习第二章:关注事件触发的自动回复
- 【微信公众号开发】自我学习第八章:群发信息
- 解决项目中报Target runtime Apache Tomcat v7.0 is not defined(项目名称处报错,项目内文件没错)
- BZOJ 4034 树上操作 (树链剖分 线段树)
- Hdu 2054 A == B ?
- 云笔记项目 Unit05
- “fullLoad” app(二)之底部导航功能实现
- 【微信公众号开发】自我学习第九章:消息模板
- 【资源分享】千图网终身vip帮大家下载
- 规范的开发流程
- tomcat 半自动部署
- vis.js network 教程一
- Maven 命令行选项
- python类部分概念
- Win2003DNS安装
- C++拷贝构造函数详解