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
9117933a
Commit
9117933a
authored
Apr 09, 2015
by
FengChen
Committed by
lanrion
Jun 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add is_to_all support in sending mass message
parent
26ca43fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
lib/weixin_authorize/api/mass.rb
+2
-2
spec/api/mass_spec.rb
+5
-0
No files found.
lib/weixin_authorize/api/mass.rb
View file @
9117933a
...
...
@@ -7,8 +7,8 @@ module WeixinAuthorize
# media_info= {"media_id" media_id}
# https://api.weixin.qq.com/cgi-bin/message/mass/sendall?access_token=ACCESS_TOKEN
def
mass_with_group
(
group_id
,
media_info
,
msgtype
=
"mpnews"
)
group_option
=
{
"filter"
=>
{
"group_id"
=>
group_id
.
to_s
}}
def
mass_with_group
(
group_id
,
media_info
,
msgtype
=
"mpnews"
,
is_to_all
=
false
)
group_option
=
{
"filter"
=>
{
"group_id"
=>
group_id
.
to_s
,
"is_to_all"
=>
is_to_all
}}
media
=
generate_media
(
msgtype
,
media_info
,
group_option
)
mass_url
=
"
#{
mass_base_url
}
/sendall"
...
...
spec/api/mass_spec.rb
View file @
9117933a
...
...
@@ -49,6 +49,11 @@ describe WeixinAuthorize::Api::Mass do
expect
(
response
.
code
).
to
eq
(
WeixinAuthorize
::
OK_CODE
)
end
it
"#mass_with_groug send to all"
do
response
=
$client
.
mass_with_group
(
"1"
,
"mass_group_text_to_all"
,
"text"
,
true
)
expect
(
response
.
code
).
to
eq
(
WeixinAuthorize
::
OK_CODE
)
end
it
"#mass_with_openids with mpnews and can delete message"
do
response
=
$client
.
mass_with_openids
([
ENV
[
"OPENID"
]],
mass_media_id
)
expect
(
response
.
code
).
to
eq
(
WeixinAuthorize
::
OK_CODE
)
...
...
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