1 package com.foxinmy.weixin4j.wxa.api;
2
3 import java.util.Map;
4 import java.util.Properties;
5
6 import com.foxinmy.weixin4j.exception.WeixinException;
7 import com.foxinmy.weixin4j.token.TokenManager;
8
9
10
11
12
13
14
15 public class SubscribeMessageApi extends TokenManagerApi {
16
17 public SubscribeMessageApi(TokenManager tokenManager) {
18 super(tokenManager, null);
19 }
20
21 public SubscribeMessageApi(TokenManager tokenManager, Properties properties) {
22 super(tokenManager, properties);
23 }
24
25
26
27
28
29
30
31
32
33
34 public void sendSubscribeMessage(
35 String toUser,
36 String templateId,
37 String page,
38 Map<String, String> data
39 ) throws WeixinException {
40
41 final SubscribeMessageParameter message = new SubscribeMessageParameter(
42 toUser, templateId, page, data
43 );
44 WxaApiResult r = this.post("wxopen_subscribe_message_send", message, WxaApiResult.TYPE_REFERENCE);
45 r.checkErrCode();
46 }
47
48 }