Module: WxExt::Api::TemplateMsg
Overview
User api of weixin.
Instance Method Summary collapse
-
#get_template_id(access_token, template_id_short) ⇒ Hash
Get the template ID via post.
-
#send_template_msg(access_token, template_msg_hash) ⇒ Hash
Send the template msg via post.
-
#set_industry(access_token, industry_id1, industry_id2) ⇒ Hash
Set the industry via post.
Instance Method Details
#get_template_id(access_token, template_id_short) ⇒ Hash
Get the template ID via post.
31 32 33 34 35 |
# File 'lib/wx_ext/api/template_msg.rb', line 31 def get_template_id(access_token, template_id_short) url = 'https://api.weixin.qq.com/cgi-bin/template/api_add_template'\ "?access_token=#{access_token}" Helper.http_post(url, { template_id_short: template_id_short }) end |
#send_template_msg(access_token, template_msg_hash) ⇒ Hash
Send the template msg via post.
42 43 44 45 46 |
# File 'lib/wx_ext/api/template_msg.rb', line 42 def send_template_msg(access_token, template_msg_hash) url = 'https://api.weixin.qq.com/cgi-bin/message/template/send'\ "?access_token=#{access_token}" Helper.http_post(url, template_msg_hash.to_json) end |
#set_industry(access_token, industry_id1, industry_id2) ⇒ Hash
Set the industry via post.
20 21 22 23 24 |
# File 'lib/wx_ext/api/template_msg.rb', line 20 def set_industry(access_token, industry_id1, industry_id2) url = 'https://api.weixin.qq.com/cgi-bin/template/api_set_industry'\ "?access_token=#{access_token}" Helper.http_post(url, { industry_id1: industry_id1, industry_id2: industry_id2 }.to_json) end |