fevans

Apr 23, 2011 at 7:55 PM

I'm trying to add a new subscriber. I get no errors after executing, but I don't see the subcriber being related to the grouping I requested.

I read the documentation best to my understanding.

Please adivise, Thanks

 

The following variables all contain vailidated values pror to execution

string apikey ;
string groupName;  //Name of the grouping to be related to
string id;   //list id
int group_id;  //The grouping id that is related to the groupName
string fname;
string lname;
string email;

//code

        listSubscribeInput li = new listSubscribeInput();
        li.parms.merge_vars.Add("FNAME",fname);
        li.parms.merge_vars.Add("LNAME",lname);
        li.parms.merge_vars.Add("INTEREST","");
        List<interestGroupings> gp = new List<interestGroupings>();

        interestGroupings igp = new interestGroupings();
        igp.name = groupName;
        igp.id = group_id;
        gp.Add(igp);

        li.parms.merge_vars.Add("Groupings",gp);
        listSubscribeParms lsParam = new listSubscribeParms(apikey, id, email, li.parms.merge_vars,EnumValues.emailType.html,true, true, true, false);
        listSubscribeInput lsInput = new listSubscribeInput(lsParam);
        listSubscribe ls = new listSubscribe(lsInput);
       
        listSubscribeOutput op = ls.Execute();