1.get access token
1 | res = RestClient.get 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='+app_id + '&secret=' + app_secret |
2.template
1 | { |
3.send
1 | res= RestClient.post 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=' + access_token, temp.to_json, {content_type: :json, accept: :json} |