Beispiel #1
0
        public bool SendMessage(SubscribeMessage message, out string errorMsg)
        {
            SendTemplateMessageTypeEnum messageTemplate;
            TmpType pageType;
            bool    sendResult = false;

            if (!Enum.TryParse(message.Template.ToString(), out messageTemplate))
            {
                errorMsg = "消息模板枚举异常【SubscribeMessage.Template】";
                return(sendResult);
            }
            if (!Enum.TryParse(message.PageType.ToString(), out pageType))
            {
                errorMsg = "小程序模板枚举异常【SubscribeMessage.ContentType】";
            }

            object sendContent = JsonConvert.DeserializeObject(message.SendContent);

            return(TemplateMsg_Miniapp.SendSubscribeMessage(message.UserId, messageTemplate, pageType, sendContent, out errorMsg));
        }