lib/blsm-mp-wx.rb in blsm-mp-wx-0.2.2 vs lib/blsm-mp-wx.rb in blsm-mp-wx-0.2.3

- old
+ new

@@ -209,24 +209,24 @@ #创建消息,存储到消息队列中 #====Parameters # * +app_id+ - 公众号的唯一标识 # * +openid+ - 发送给用户的openid # * +content+ - 消息内容 - # * +msg_name+ - 消息种类:new_order(新订单通知)、balance(结算通知)、score_change(积分变动通知)、custom(普通消息) + # * +msg_name+ - 消息种类:new_order(新订单通知)、balance(结算通知)、score_change(积分变动通知)、order(订单通知)、todo(待处理)、split_order(分单)、custom(普通消息) # new_order => content: {touser:'openid',order_id:''} 系统自动优先使用模板消息发送通知 # balance => content: {touser:'openid',clearing_id} 系统自动优先使用模板消息发送通知 # score_change => content: {touser:'',change:5,total:25,content:'邀请他人。。。。'} def create_msg(app_id=nil, openid, content, msg_name) app_id ||= self.APP_ID return nil unless openid return nil unless content[:touser]==openid - return nil unless %w(new_order balance score_change distribute custom split_order).include?(msg_name) + return nil unless %w(new_order balance score_change distribute custom split_order order todo).include?(msg_name) VdMpMsg.create({ app_id: app_id, openid: openid, content: content.to_json, msg_name: msg_name, - template_msg: %w(new_order balance score_change distribute split_order).include?(msg_name), + template_msg: %w(new_order balance score_change distribute split_order order todo).include?(msg_name), status: 'none' }) end #批量获取公众号的素材列表