How to update address field type?

Aug 6, 2011 at 4:00 AM
Edited Aug 6, 2011 at 10:49 AM

Hi,

I'm try to update user address which maps to MMERGE3 in mailchimp. I need to do something like this

$merges = array('FNAME'=>'Dave', 'LNAME'=>'Gilmour', 

'MMERGE3'=>array('addr1'=>'12335 Hope St', 'city'=>'Dallas', 'state'=>'TX'  ))

 

Im trying to do something like this which didn't work

var mc = new MCApi(key,true);
var merges = new List.Merges(EMAIL.Value, List.EmailType.Html) { {"FNAME",FNAME.Value},
{"MMERGE3", new List.Merges() {{"addr1",addr1.Value},{"city",city.Value},{"state",state.Value}}},
{"MMERGE4", company.Value}
};
Opt<List.Merges> mergeList = new Opt<List.Merges>(merges);
mc.ListSubscribe(listid, EMAIL.Value, mergeList, new Opt<List.SubscribeOptions>(new List.SubscribeOptions {UpdateExisting = true})

FNAME, MMERGE4 gets updated correctly but the MMERGE3 doesn't map to address field in mailchimp.

Aug 7, 2011 at 4:11 AM

Just need to use a dictionary for merge3. This worked for me.

var merges = new List.Merges(EMAIL.Value, List.EmailType.Html) { {"FNAME",FNAME.Value},
{"MMERGE3", new Dictionary<string,object> {{"addr1",addr1.Value},{"city",city.Value},{"state",state.Value},{"zip",zip.Value},{"country",country.Value"}}}};