模板消息修改
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
|
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
|
||||||
|
|
Loading…
Reference in New Issue