当前位置: 首页>>代码示例>>C#>>正文


C# MailChimpManager.GetLists方法代码示例

本文整理汇总了C#中MailChimpManager.GetLists方法的典型用法代码示例。如果您正苦于以下问题:C# MailChimpManager.GetLists方法的具体用法?C# MailChimpManager.GetLists怎么用?C# MailChimpManager.GetLists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MailChimpManager的用法示例。


在下文中一共展示了MailChimpManager.GetLists方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetDefaultSubscribersList

 private void SetDefaultSubscribersList(string accessToken, string dataCenter)
 {
     var mc = new MailChimpManager(accessToken, dataCenter);
     var lists = mc.GetLists();
     if (lists.Data.Any())
         _settingsManager.SetValue(_subscribersListIdPropertyName, lists.Data[0].Id);
 }
开发者ID:adwardliu,项目名称:vc-community,代码行数:7,代码来源:MCAuthorizationController.cs

示例2: BatchSubscribe_Successful

        public void BatchSubscribe_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();

            List<BatchEmailParameter> emails = new List<BatchEmailParameter>();

            BatchEmailParameter email1 = new BatchEmailParameter()
            {
                Email = new EmailParameter()
                {
                    Email = "[email protected]"
                }
            };

            BatchEmailParameter email2 = new BatchEmailParameter()
            {
                Email = new EmailParameter()
                {
                    Email = "[email protected]"
                }
            };

            emails.Add(email1);
            emails.Add(email2);

            //  Act
            BatchSubscribeResult results = mc.BatchSubscribe(lists.Data[1].Id, emails);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(results.AddCount == 2);
        }
开发者ID:penfold,项目名称:MailChimp.NET,代码行数:34,代码来源:ListTests.cs

示例3: GetMemberActivity_Successful

        public void GetMemberActivity_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            
            ListResult lists = mc.GetLists();
            Assert.IsNotNull(lists.Data);
            Assert.IsTrue(lists.Data.Any());

            MembersResult members = mc.GetAllMembersForList(lists.Data[0].Id);
            Assert.IsNotNull(members.Data);
            Assert.IsTrue(members.Data.Any());

            List<EmailParameter> memberEmails = new List<EmailParameter>();

            foreach (MemberInfo member in members.Data)
            {
                memberEmails.Add(new EmailParameter() { Email = member.Email });
            }

            //  Act
            MemberActivityResult results = mc.GetMemberActivity(lists.Data[0].Id, memberEmails);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(results.Data.Any());
        }
开发者ID:CaudronThomas,项目名称:MailChimp.NET,代码行数:27,代码来源:ListTests.cs

示例4: Send

        public void Send(String idUser, String firstName, String email)
        {
            String emailAPI = ConfigurationManager.AppSettings["MailChimpAPI"].ToString();

            MailChimpManager mc = new MailChimpManager(emailAPI);

            ListResult lists = mc.GetLists();

            EmailConfirm emailConfirm = new EmailConfirm();
            //emailConfirm.Groupings = new List<Grouping>();
            //emailConfirm.Groupings.Add(new Grouping());
            //emailConfirm.Groupings[0].Id = 1234; // replace with your grouping id
            //emailConfirm.Groupings[0].GroupNames = new List<string>();
            //emailConfirm.Groupings[0].GroupNames.Add("Your Group Name");
            emailConfirm.FirstName = firstName;
            emailConfirm.IdUser = idUser;

            //  Create the email parameter
            EmailParameter parameters = new EmailParameter()
            {
                Email = email
            };

            //            ListResult lr = mc.GetLists();
            EmailParameter results = mc.Subscribe("d31fd680be", parameters, emailConfirm);
        }
开发者ID:NannyWeb,项目名称:Nanny,代码行数:26,代码来源:EmailHelper.cs

示例5: Update

        public ActionResult Update(string id)
        {
            var defaultEvent = service.GetDefaultEvent();
            int eventid = defaultEvent.ID;
            MailChimpManager mc = new MailChimpManager(_mailchimpKey);
            ListInfo mailingList = mc.GetLists().Data.Where(l=>l.Id==id).SingleOrDefault();
            List<BatchEmailParameter> batchList = new List<BatchEmailParameter>();
            if (mailingList.Name.Contains("Speakers"))
            {
                foreach (var speaker in service.GetSpeakers(eventid))
                {
                    MyMergeVar myMergeVars = new MyMergeVar();
                    myMergeVars.FirstName = speaker.FirstName;
                    myMergeVars.LastName = speaker.LastName;           //  Create the email parameter
                    BatchEmailParameter batchEmail = new BatchEmailParameter();
                    EmailParameter email = new EmailParameter()
                    {
                        Email = speaker.Email

                    };
                    batchEmail.Email = email;
                    batchEmail.MergeVars = myMergeVars;

                    batchList.Add(batchEmail);
                }
            }
            if (mailingList.Name.Contains("Attendees"))
            {
                foreach (var attendee in service.GetAllAttendees(eventid))
                {
                    MyMergeVar myMergeVars = new MyMergeVar();
                    myMergeVars.FirstName = attendee.FirstName;
                    myMergeVars.LastName = attendee.LastName;           //  Create the email parameter
                    EmailParameter email = new EmailParameter()
                    {
                        Email = attendee.Email
                    };
                    BatchEmailParameter batchEmail = new BatchEmailParameter();
                    batchEmail.Email = email;
                    batchEmail.MergeVars = myMergeVars;

                    batchList.Add(batchEmail);

                }

            }
            BatchSubscribeResult bResult = mc.BatchSubscribe(id, batchList, false, true, true);
            //MyMergeVar myMergeVars = new MyMergeVar();
            //myMergeVars.FirstName = subscriber.FirstName;
            //myMergeVars.LastName = subscriber.LastName;           //  Create the email parameter
            //EmailParameter email = new EmailParameter()
            //{
            //    Email = subscriber.EmailAddress
            //};

            //EmailParameter results = mc.Subscribe(_mailchimpGroupId, email, myMergeVars);

            return RedirectToAction("Index");
        }
开发者ID:cfranciscodev,项目名称:WebSite,代码行数:59,代码来源:MailingListController.cs

示例6: GetLists_Successful

        public void GetLists_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);

            //  Act
            ListResult details = mc.GetLists();

            //  Assert
            Assert.IsNotNull(details.Data);
        }
开发者ID:RomeoQNgo,项目名称:MailChimp.NET,代码行数:11,代码来源:ListTests.cs

示例7: Index

        //
        // GET: /MailingList/
        public ActionResult Index()
        {
            var defaultEvent = service.GetDefaultEvent();
            int eventid = defaultEvent.ID;
            ViewBag.Event = service.GetEvent(eventid);
            int eventYear = ViewBag.Event.StartTime.Year;

            MailChimpManager mc = new MailChimpManager(_mailchimpKey);
            List<ListInfo> mailingLists = mc.GetLists().Data.Where(l=>l.Name.Contains(eventYear.ToString())).ToList();
            return View(mailingLists);
        }
开发者ID:cfranciscodev,项目名称:WebSite,代码行数:13,代码来源:MailingListController.cs

示例8: GetAbuseReport_Successful

        public void GetAbuseReport_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();

            //  Act
            AbuseResult details = mc.GetListAbuseReports(lists.Data[0].Id);

            //  Assert
            Assert.IsNotNull(details.Data);
        }
开发者ID:RomeoQNgo,项目名称:MailChimp.NET,代码行数:12,代码来源:ListTests.cs

示例9: GetListActivity_Successful

        public void GetListActivity_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();

            //  Act
            List<ListActivity> results = mc.GetListActivity(lists.Data[1].Id);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(results.Any());
        }
开发者ID:RomeoQNgo,项目名称:MailChimp.NET,代码行数:13,代码来源:ListTests.cs

示例10: StaticSegment_Successful

        public void StaticSegment_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
           

            //  Act
            List<StaticSegment> results = mc.GetStaticSegmentsFromList(lists.Data[1].Id);

            //  Assert
            Assert.IsNotNull(results);
        }
开发者ID:smogHead,项目名称:MailChimp.NET,代码行数:13,代码来源:ListTests.cs

示例11: GetListInterestGroupings_Successful

        public void GetListInterestGroupings_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager("efb48a02f2f56120e2f3f6e2fef71803-us6");
            ListResult lists = mc.GetLists(new ListFilter(){ListName = "TestAPIGetInterestGroup"});
            Assert.IsNotNull(lists);
            Assert.IsTrue(lists.Data.Any());
            //  Act
            List<InterestGrouping> results = mc.GetListInterestGroupings(lists.Data.FirstOrDefault().Id);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(results.Any());
        }
开发者ID:RomeoQNgo,项目名称:MailChimp.NET,代码行数:14,代码来源:ListTests.cs

示例12: Subscribe_Successful

        public void Subscribe_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
            EmailParameter email = new EmailParameter()
            {
                Email = "[email protected]"
            };

            //  Act
            EmailParameter results = mc.Subscribe(lists.Data[1].Id, email);

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(!string.IsNullOrEmpty(results.LEId));
        }
开发者ID:RomeoQNgo,项目名称:MailChimp.NET,代码行数:17,代码来源:ListTests.cs

示例13: CampaignSegmentTest_Successful

 public void CampaignSegmentTest_Successful()
 {
     //  Arrange
     MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
     ListResult lists = mc.GetLists();
     CampaignSegmentOptions options = new CampaignSegmentOptions();
     options.Match= "All";
     string dateListCreated = lists.Data[1].DateCreated;
     List<CampaignSegmentCriteria> conditions = new List<CampaignSegmentCriteria>();
     conditions.Add(new CampaignSegmentCriteria { Field = "date", Operator = "eq", Value = dateListCreated });
     options.Conditions = conditions;
     string listId = lists.Data[1].Id;
     //  Act
     CampaignSegmentTestResult result = mc.CampaignSegmentTest(listId,options);          
     //  Assert
     Assert.IsTrue(result.Total == 1);
 }
开发者ID:RomeoQNgo,项目名称:MailChimp.NET,代码行数:17,代码来源:CampaignTests.cs

示例14: StaticSegmentAdd_Successful

        public void StaticSegmentAdd_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
           
            //Get existing segments
            List<StaticSegment> segments = mc.GetStaticSegmentsFromList(lists.Data[1].Id);
            StaticSegmentDeleteResult deleteResult;

            //Check to see if test segment exists, delete if it does.
            if (segments.Where(x => x.Name == "TestSegment").Count() > 0)
                deleteResult = mc.StaticSegmentDelete(lists.Data[1].Id, segments.Where(x => x.Name == "TestSegment").FirstOrDefault().Id);

            //  Act
            StaticSegmentAddResult results = mc.StaticSegmentAdd(lists.Data[1].Id, "TestSegment");

            //  Assert
            Assert.IsTrue(!string.IsNullOrEmpty(results.Id));
        }
开发者ID:smogHead,项目名称:MailChimp.NET,代码行数:20,代码来源:ListTests.cs

示例15: ExportGetListsWithSinceFilterInFuture_Successful

        public void ExportGetListsWithSinceFilterInFuture_Successful()
        {
            //  Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            MailChimpExportManager mce = new MailChimpExportManager(TestGlobal.Test_APIKey);

            ListResult lists = mc.GetLists();
            Assert.IsNotNull(lists.Data);
            Assert.IsTrue(lists.Data.Any());

            string listId = lists.Data[0].Id;
            Assert.IsNotNull(lists.Data[0].Id);

            //  Act
            var results = mce.GetAllMembersForList(listId, since: DateTime.UtcNow.AddDays(1).ToString() );

            //  Assert
            Assert.IsNotNull(results);
            Assert.IsTrue(results.Count == 0, "Export should contain 0 records. No record should have a LAST_UPDATED date in the future.");
        }
开发者ID:erpframework,项目名称:MailChimp.NET,代码行数:20,代码来源:ExportTests.cs


注:本文中的MailChimpManager.GetLists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。