Skip to content

Commit

Permalink
Merge 51cd600 into 68d97c4
Browse files Browse the repository at this point in the history
  • Loading branch information
befinal committed Dec 27, 2017
2 parents 68d97c4 + 51cd600 commit 4260684
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/api_template.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,19 @@ exports.addTemplate = async function (templateIdShort) {
* @param {String} openid 用户的openid
* @param {String} templateId 模板ID
* @param {String} url URL置空,则在发送后,点击模板消息会进入一个空白页面(ios),或无法点击(android)
* @param {String} appid 小程序 appid
* @param {String} pagepath 小程序路径
* @param {String} topColor 字体颜色
* @param {Object} data 渲染模板的数据
* @param {String} color 字体颜色
* @param {Object} miniprogram 跳转小程序所需数据 {appid, pagepath}
*/
exports.sendTemplate = async function (openid, templateId, url, appid, pagepath, data, color) {
exports.sendTemplate = async function (openid, templateId, url, topColor, data, miniprogram) {
const { accessToken } = await this.ensureAccessToken();
var apiUrl = this.prefix + 'message/template/send?access_token=' + accessToken;
var template = {
touser: openid,
template_id: templateId,
url: url,
miniprogram: {
appid: appid,
pagepath: pagepath
},
color: color,
miniprogram: miniprogram,
color: topColor,
data: data
};
return this.request(apiUrl, postJSON(template));
Expand Down

0 comments on commit 4260684

Please sign in to comment.