Module: Model::Notice::PublicNotice
- Included in:
- Wechat::PublicNotice
- Defined in:
- app/models/wechat/model/notice/public_notice.rb
Constant Summary collapse
- BASE =
'https://api.weixin.qq.com/cgi-bin/'
Instance Method Summary collapse
Instance Method Details
#do_send ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/models/wechat/model/notice/public_notice.rb', line 5 def do_send r = app.api.post 'message/template/send', **, base: BASE if r['errcode'] == 0 self.update msg_id: r['msgid'] subscribe.update sending_at: Time.now if subscribe else r end end |
#message_hash ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/models/wechat/model/notice/public_notice.rb', line 15 def { touser: wechat_user.uid, template_id: template.template_id, url: link, data: data } end |