| | |
| | | if (option == null || option.AppId.IsNull() || option.AppSecret.IsNull()) |
| | | throw Oops.Oh(EnumErrorCodeType.s400, "发送订阅消息失败,缺失配置:WxmpOptions"); |
| | | command.EnvVersion = option.EnvVersion; |
| | | if (!options.Value.SubscribMessageTemplates.ContainsKey(command.TemplateId)) |
| | | throw Oops.Oh(EnumErrorCodeType.s400, "发送订阅消息失败,模板不存在"); |
| | | var template = options.Value.SubscribMessageTemplates[command.TemplateId]; |
| | | command.TemplateId = template.TemplateId; |
| | | if (command.Page.IsNull()) command.Page = template.Page; |
| | | //if (!options.Value.SubscribMessageTemplates.ContainsKey(command.TemplateId)) |
| | | // throw Oops.Oh(EnumErrorCodeType.s400, "发送订阅消息失败,模板不存在"); |
| | | //var template = options.Value.SubscribMessageTemplates[command.TemplateId]; |
| | | //command.TemplateId = template.TemplateId; |
| | | //if (command.Page.IsNull()) command.Page = template.Page; |
| | | var accessToken = await GetAccessToken(command.WxmpCode); |
| | | var jsonContent = JsonConvert.SerializeObject(command, new JsonSerializerSettings |
| | | { |