Module: Model::Notice::ProgramNotice

Included in:
Wechat::ProgramNotice
Defined in:
app/models/wechat/model/notice/program_notice.rb

Constant Summary collapse

BASE =
'https://api.weixin.qq.com/cgi-bin/'

Instance Method Summary collapse

Instance Method Details

#do_sendObject



6
7
8
# File 'app/models/wechat/model/notice/program_notice.rb', line 6

def do_send
  app.api.post 'message/subscribe/send', **message_hash, base: BASE
end

#message_hashObject



10
11
12
13
14
15
16
# File 'app/models/wechat/model/notice/program_notice.rb', line 10

def message_hash
  {
    template_id: template.template_id,
    touser: wechat_user.uid,
    data: data
  }
end