Commit 7cd61b21 by wikimo Committed by lanrion

[wikimo] add send_mpnews_custom with media_id (#91)

parent 5c108307
...@@ -62,6 +62,21 @@ module WeixinAuthorize ...@@ -62,6 +62,21 @@ module WeixinAuthorize
http_post(custom_base_url, message) http_post(custom_base_url, message)
end end
# 根据media_id发送图文消息
# {
# "touser":"OPENID",
# "msgtype":"mpnews",
# "mpnews":
# {
# "media_id":"MEDIA_ID"
# }
# }
def send_mpnews_custom(to_user, media_id, options={})
mpnews_options = {media_id: media_id}.merge(options)
message = default_options(to_user, "mpnews").merge({mpnews: mpnews_options})
http_post(custom_base_url, message)
end
# 发送音乐消息 # 发送音乐消息
# { # {
# "touser":"OPENID", # "touser":"OPENID",
......
...@@ -44,6 +44,10 @@ describe WeixinAuthorize::Api::Custom do ...@@ -44,6 +44,10 @@ describe WeixinAuthorize::Api::Custom do
pending("The test must have a media_id") pending("The test must have a media_id")
end end
it "#send_mpnews_custom" do
pending("The test must have a media_id")
end
it "#send_music_custom" do it "#send_music_custom" do
pending("The test must have a media_id") pending("The test must have a media_id")
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment