模板消息修改

This commit is contained in:
guange 2016-04-08 11:19:05 +08:00
parent 0731405828
commit 5cc0ac04e6
1 changed files with 5 additions and 8 deletions

View File

@ -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 logger.info "start send template message: #{data}"
res = Net::HTTP.new(uri.host, uri.port).start do |client| req = Wechat.api.template_message_send Wechat::Message.to(uw.openid).template(data)
request = Net::HTTP::Post.new(uri.path) logger.info "send over. #{req}"
request.body = body
request["Content-Type"] = "application/json"
client.request(request)
end
end end
end end
end end