点击查看班级详情跳入班级信息页面

This commit is contained in:
yuanke 2016-07-12 17:08:16 +08:00
parent 824f9d9174
commit 4a7fb0e0b5
1 changed files with 29 additions and 1 deletions

View File

@ -285,7 +285,35 @@ class WechatService
def create_class_notice(user_id, type, id, first, key1, key2, key3, remark="")
uw = UserWechat.where(user_id: user_id).first
unless uw.nil?
data = three_keys_template uw.openid,Wechat.config.create_class_notice, type, id, first, key1, key2, key3, remark
data = {
touser:uw.openid,
template_id:Wechat.config.create_class_notice,
url:"#{Setting.protocol}://#{Setting.host_name}/wechat/user_activities#/class?id="+id.to_s,
topcolor:"#FF0000",
data:{
first: {
value:first,
color:"#707070"
},
keyword1:{
value:key1,
color:"#707070"
},
keyword2:{
value:key2,
color:"#707070"
},
keyword2:{
value:key3,
color:"#707070"
},
remark:{
value:remark,
color:"#707070"
}
}
}
#data = three_keys_template uw.openid,Wechat.config.create_class_notice, type, id, first, key1, key2, key3, remark
begin
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
rescue Exception => e