Ejemplo n.º 1
0
        private string CreateTemplateFromCosmosDocument(AuthenticationDetails auth, string clientID, CampaignDocument campaign)
        {
            string template = string.Empty;

            try
            {
                var htmlText   = WebUtility.HtmlDecode(GenerateTemplateCampaignMonitorFromCosmosDocument(campaign));
                var templateID = BlobManager.CreateHtmlTemplateAzure(htmlText);
                template = Template.Create(auth, clientID, "TEMPLATE " + campaign.Name, templateID, "");
            }
            catch (Exception e)
            {
                var messageException = telemetria.MakeMessageException(e, System.Reflection.MethodBase.GetCurrentMethod().Name);
                telemetria.Critical(messageException);
            }
            return(template);
        }