Пример #1
0
        //用户试听课微信提醒
        public IActionResult OnPostWxRemind(long Id)
        {
            ResultNormal result = new ResultNormal();

            try
            {
                var trial = _CourseSrv.GetTrialLogById(Id);

                //微信发送
                UserTrialRemindTemplate wxMessage = new UserTrialRemindTemplate();
                wxMessage.data = wxMessage.GenerateData(trial.OpenId, trial);
                WXApi.SendTemplateMessage <UserTrialRemindTemplate>(wxMessage);

                if (result.IsSuccess)
                {
                    _CourseSrv.AddTrialRemindCount(Id);
                }
            }
            catch (Exception ex)
            {
                result.ErrorMsg = ex.Message;
            }

            return(new JsonResult(result));
        }