private static void CreateCampaign()
        {
            // Arrange
            MailChimpManager mc = new MailChimpManager("e20533551f21cbc6b07c76e570dc33c4-us11");
            //ListResult lists = mc.GetLists();
            //string listID = lists.Data[0].Id;
            CampaignSegmentOptions segmentOptions = new CampaignSegmentOptions();
            segmentOptions.Match = "All";
            //string dateListCreated = lists.Data[0].DateCreated;
            segmentOptions.Conditions = new List<CampaignSegmentCriteria>();
            segmentOptions.Conditions.Add(new CampaignSegmentCriteria { Field = "date", Operator = "eq"});
            CampaignCreateContent content = new CampaignCreateContent();
            content.HTML = @"
            <meta charset='utf-8'>
            <title></title>

            <table width='600' border='0' align='center' cellpadding='0' cellspacing='0' style='background-color: #f0eeee; padding: 20px;'>
            <tbody><tr>
            <td>
                <table width='600' border='0' align='center' cellpadding='0' cellspacing='0'>
                    <tbody><tr>
                        <td style='background-color: #ffa900; padding: 10px 30px;'>
                            <img src='http://*****:*****@desme.com";
            options.FromName = "Testing Company Name";
            options.Subject = "Email template testing";
            Campaign result = mc.CreateCampaign("regular", options, content);
        }
        public void CampaignCreate_Successful()
        {
            // Arrange
            MailChimpManager mc = new MailChimpManager(TestGlobal.Test_APIKey);
            ListResult lists = mc.GetLists();
            string listID = lists.Data[1].Id;
            CampaignSegmentOptions segmentOptions = new CampaignSegmentOptions();
            segmentOptions.Match = "All";
            string dateListCreated = lists.Data[1].DateCreated;
            segmentOptions.Conditions = new List<CampaignSegmentCriteria>();
            segmentOptions.Conditions.Add(new CampaignSegmentCriteria { Field = "date", Operator = "eq", Value = dateListCreated });
            CampaignCreateContent content = new CampaignCreateContent();
            content.HTML = "<p>Testing</p>";
            CampaignCreateOptions options = new CampaignCreateOptions();
            options.Title = "Testing";
            options.ListId = listID;
            options.ToName = "Test Name";
            options.FromEmail = "*****@*****.**";
            options.FromName = "Testing Company Name";
            options.Subject = "Test Subject";

            //Act
            Campaign result = mc.CreateCampaign("regular", options, content, segmentOptions, null);
            // Assert
            Assert.IsNotNull(result);
        }
        public void SendCampaign()
        {
            if ((cmbTemplate.SelectedIndex > 0 && cmbTemplate.SelectedItem != null) && (cmbList.SelectedIndex > 0 && cmbList.SelectedItem != null))
            {
                Int32 selectedTemplateId = Convert.ToInt32(cmbTemplate.SelectedValue);

                string selectedListId = cmbList.SelectedValue.ToString();
                //IEnumerable<string> listEnum = new string[] { selectedListId.ToString() };

                //--Create Campaign
                CampaignSegmentOptions segmentOptions = new CampaignSegmentOptions();
                segmentOptions.Match = "All";
                CampaignCreateOptions options = new CampaignCreateOptions();
                options.Title = mailchimptitle;
                options.ListId = selectedListId;
                options.ToName = mailchimpToName;
                options.FromEmail = mailchimpFromEmail;
                options.FromName = mailchimpFromName;
                options.Subject = mailchimpSubject;
                options.TemplateID = selectedTemplateId;
                CampaignCreateContent content = new CampaignCreateContent();
                Campaign result = mc.CreateCampaign("regular", options, content, null, null);


                //GetMemberInfo
                if (chkEnableSMS.Checked)
                {
                    List<EmailParameter> emails = new List<EmailParameter>();
                    MembersResult results = mc.GetAllMembersForList(selectedListId, "subscribed", 0, 100);
                    foreach (var i in results.Data)
                    {
                        foreach (var j in i.MemberMergeInfo)
                        {
                            if (j.Key.Trim() == "PHONE")
                            {
                                if (!string.IsNullOrEmpty(j.Value.ToString()))
                                {
                                    //  SmsSender.SendSMS(j.Value.ToString(), "919460264151", "5b2a23d7", "59d9fa03", Uri.EscapeUriString("Test Message"));
                                }
                            }
                        }
                    }
                }
            }
            MessageBox.Show("Success");
            this.Close();
        }