Пример #1
0
        public static string SendMsg(MiniProgramTemplate template)
        {
            if (string.IsNullOrEmpty(template.touser) || string.IsNullOrEmpty(template.form_id))
            {
                return("");
            }
            string url    = $"https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token={GetToken()}";
            string result = LeoHttpHelper.Post(url, JsonConvert.SerializeObject(template));

            return(result);
        }
Пример #2
0
 public TemplateMessageProvider(WeChatAccessTokenManager tokenManager)
 {
     this.tokenManager   = tokenManager;
     offiAccountTemplate = new OffiAccountTemplate();
     miniProgramTemplate = new MiniProgramTemplate();
 }