lib/blsm-mp-wx.rb in blsm-mp-wx-0.2.7 vs lib/blsm-mp-wx.rb in blsm-mp-wx-0.2.8
- old
+ new
@@ -219,11 +219,11 @@
# * +content+ - 消息内容
# * +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, openid, content, msg_name, template_msg=false)
+ def create_msg(app_id, openid, content, msg_name, template_msg=true)
app_id ||= self.APP_ID
return nil unless openid
return nil unless content[:touser]==openid
# return nil unless MP_MSG_TYPES.include?(msg_name)
VdMpMsg.create({
@@ -235,10 +235,10 @@
status: 'none'
})
end
- def create_msg!(app_id, openid, content, msg_name, template_msg=false)
+ def create_msg!(app_id, openid, content, msg_name, template_msg=true)
app_id ||= self.APP_ID
VdMpMsg.create!({
app_id: app_id,
openid: openid,
content: content.to_json,