/// <summary> /// 关注公众号 /// </summary> /// <param name="data"></param> private void SubscribeEvent(WxEventModel data, string content) { //WxUserBaseInfoModel model = GetBaseByOpenid(data.FromUserName); CsMsgModel msgModel = new CsMsgModel(); msgModel.msgtype = MsgType.text; msgModel.touser = @"oQQbc1XNMQ9cEd5ROVZjgM5WToAA"; msgModel.text = new { content = content }; SendCsMsg(msgModel); }
/// <summary> /// 发送客服消息 /// </summary> /// <param name="msg"></param> private BaseModel SendCsMsg(CsMsgModel model) { BaseModel res = null; try { string acctoken = GetAccesstoken(); string url = @"https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" + acctoken; BaseModel resmodel = BuildPost(model, url); } catch (Exception ex) { LogHelper.WriteLog(ex, "SendCsMsg"); res = new BaseModel(); } return(res); }