模板消息修改
This commit is contained in:
parent
0731405828
commit
5cc0ac04e6
|
@ -1150,14 +1150,11 @@ class Mailer < ActionMailer::Base
|
|||
}
|
||||
}
|
||||
}
|
||||
uri = URI("https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=1234567")
|
||||
body = data.to_json
|
||||
res = Net::HTTP.new(uri.host, uri.port).start do |client|
|
||||
request = Net::HTTP::Post.new(uri.path)
|
||||
request.body = body
|
||||
request["Content-Type"] = "application/json"
|
||||
client.request(request)
|
||||
end
|
||||
|
||||
logger.info "start send template message: #{data}"
|
||||
req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
|
||||
logger.info "send over. #{req}"
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue