Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weixin_authorize
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
weixin_authorize
Commits
6629f8bc
Commit
6629f8bc
authored
Jan 29, 2015
by
lanrion
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #41 from lanrion/add-template-message-api
添加模板消息接口
parents
aaeab9ab
25cf7b25
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
lib/weixin_authorize/api.rb
+1
-0
lib/weixin_authorize/api/template.rb
+29
-0
lib/weixin_authorize/client.rb
+1
-0
No files found.
lib/weixin_authorize/api.rb
View file @
6629f8bc
...
...
@@ -5,3 +5,4 @@ require "weixin_authorize/api/groups"
require
"weixin_authorize/api/qrcode"
require
"weixin_authorize/api/media"
require
"weixin_authorize/api/oauth"
require
"weixin_authorize/api/template"
lib/weixin_authorize/api/template.rb
0 → 100644
View file @
6629f8bc
# encoding: utf-8
module
WeixinAuthorize
module
Api
module
Template
# 设置所属行业
def
set_template_industry
(
industry_id1
,
industry_id2
)
industries
=
{
industry_id1:
industry_id1
,
industry_id2:
industry_id2
}
http_post
(
"/template/api_set_industry"
,
industries
)
end
# 获得模板ID
# code: 模板库中模板的编号,有“TM**”和“OPENTMTM**”等形式
def
add_template
(
code
)
http_post
(
"/template/api_add_template"
,
template_id_short:
code
)
end
# 发送模板消息
def
send_template_msg
(
touser
,
template_id
,
url
,
topcolor
,
data
)
msg
=
{
touser:
touser
,
template_id:
template_id
,
url:
url
,
topcolor:
topcolor
,
data:
data
}
http_post
(
"/message/template/send"
,
msg
)
end
end
end
end
lib/weixin_authorize/client.rb
View file @
6629f8bc
...
...
@@ -11,6 +11,7 @@ module WeixinAuthorize
include
Api
::
Qrcode
include
Api
::
Media
include
Api
::
Oauth
include
Api
::
Template
attr_accessor
:app_id
,
:app_secret
,
:expired_at
# Time.now + expires_in
attr_accessor
:access_token
,
:redis_key
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment