Пример #1
0
        static void GetTemplates(MailChimpManager mailChimp)
        {
            // just get the 5th template which matches the given filter
            var result = mailChimp.GetTemplates(offset: 5, count: 1, filter: new TemplatesInstance()
            {
                Active = true, Type = "base"
            });

            // get all templates which match the same given filter
            var fullResult = mailChimp.GetTemplates(count: result.TotalItems,
                                                    filter: new TemplatesInstance()
            {
                Active = true, Type = "base"
            });
        }
Пример #2
0
        public void GetTemplates_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);

            //  Act
            TemplateListResult details = mc.GetTemplates();

            //  Assert
            Assert.IsNotNull(details);
        }
Пример #3
0
        public void GetTemplates_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);

            //  Act
            TemplateListResult details = mc.GetTemplates();

            //  Assert
            Assert.IsNotNull(details);
        }
Пример #4
0
        public void MailChimpLoad()
        {
            // CampaignListResult details = mc.GetCampaigns();
            //CampaignFilter options = new CampaignFilter();
            //options.CampaignId = "a5a9439561";
            //CampaignListResult ss = mc.GetCampaigns(options);


            //-- Template
            List <MailChimpList> mailChimpTemplate = new List <MailChimpList>();

            mailChimpTemplate.Add(new MailChimpList("0", "Select Template"));
            var types = new TemplateTypes()
            {
                User = true,
            };
            var filters = new TemplateFilters()
            {
                IncludeInactive    = false,
                IncludeDragAndDrop = true
            };

            TemplateListResult details = mc.GetTemplates(types, filters);

            foreach (var list in details.UserTemplates)
            {
                mailChimpTemplate.Add(new MailChimpList(list.TemplateID.ToString(), list.Name));
            }
            if (mailChimpTemplate != null && mailChimpTemplate.Count > 0)
            {
                cmbTemplate.DisplayMember = "Name";
                cmbTemplate.ValueMember   = "Id";
                cmbTemplate.DataSource    = mailChimpTemplate;
            }


            // --- List---
            List <MailChimpList> mailChimpList = new List <MailChimpList>();
            ListResult           lists         = mc.GetLists();

            mailChimpList.Clear();
            mailChimpList.Add(new MailChimpList("0", "Select List"));
            foreach (var list in lists.Data)
            {
                mailChimpList.Add(new MailChimpList(list.Id.ToString(), list.Name));
            }
            if (mailChimpList != null && mailChimpList.Count > 0)
            {
                cmbList.DisplayMember = "Name";
                cmbList.ValueMember   = "Id";
                cmbList.DataSource    = mailChimpList;
            }
        }
Пример #5
0
        public void GetTemplates_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            var types           = new TemplateTypes()
            {
                User = true
            };
            var filters = new TemplateFilters()
            {
                IncludeInactive = false
            };
            //  Act
            TemplateListResult details = mc.GetTemplates(types, filters);

            //  Assert
            Assert.IsNotNull(details);
        }
Пример #6
0
        static void GetTemplates(MailChimpManager mailChimp)
        {
            // just get the 5th template which matches the given filter
            var result = mailChimp.GetTemplates(offset: 5, count: 1, filter: new TemplatesInstance() { Active = true, Type = "base"});

            // get all templates which match the same given filter
            var fullResult = mailChimp.GetTemplates(count: result.TotalItems,
                filter: new TemplatesInstance() {Active = true, Type = "base"});
        }
Пример #7
0
        public void GetTemplates_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            var types = new TemplateTypes()
            {
                User = true
            };
            var filters = new TemplateFilters()
            {
                IncludeInactive = false
            };
            //  Act
            TemplateListResult details = mc.GetTemplates(types, filters);

            //  Assert
            Assert.IsNotNull(details);
        }