Add segment in Campagin

Dec 8, 2010 at 7:23 PM

Hi,

 

I am trying to add segment in campaign. Actually I like to add some user on the basis of segment from a list. I am able to create campaign but not getting how to add segment for campaign.

Below is my code for creating campaign

 

 campaignTemplates template = new campaignTemplates(templateInp);
            campaignTemplatesOutput tempOut = template.Execute();

            campaignCreateInput input = new campaignCreateInput();
            input.parms.type = PerceptiveMCAPI.EnumValues.campaign_type.regular;
            input.api_Validate = false;
            campaignCreateOptions options = new campaignCreateOptions();

            options.from_email = "jeff.vail@instantcommunity.com";
            //options.from_name = "*|FNAME|*";
            options.list_id = "aa30561e03";
            options.subject = "The Goldriver Daily";
            //options.template_id = 150561;
            options.to_email = "*|FNAME|*";
            options.title ="The Goldriver Daily(" + DateTime.Now.Date.ToString() + ")";
            input.parms.options = options;

            Dictionary content = new Dictionary();
            content.Add("html", GetFormURL());
            content.Add("text", GetFormURL());
            input.parms.content = content;

            campaignCreate cmd = new campaignCreate(input);
            campaignCreateOutput campaignCreateout = cmd.Execute();
            return campaignCreateout;

 

I am looking forward for some response.

Thanks,

Tarun

Coordinator
Dec 9, 2010 at 11:16 AM

You need to review the campaignSegmentTest() method documentation for what options are available.
//
campaignSegmentOptions seg = new campaignSegmentOptions();
seg.match = "any";
// one or more conditions
campaignSegmentCondition cond = new campaignSegmentCondition();
cond.field = "initials";
cond.op = "eq";
cond.value = "dbm";
seg.conditions.Add( cond );
//
input.parms.segment_opts = seg;

Jul 27, 2012 at 8:04 PM

campaignSegmentTest() is good for segmenting a list based on other existing fields, but it does not let you create a new static segment.

It seems the MailChimp API method listStaticSegmentAdd is not implemented.

Will it be added at some point?