ListSubscribe method: FNAME and LNAME merge fields doesn't works

Feb 4, 2011 at 2:19 PM

Hi,

I am subscribing people into a mailchimp list. Using the listSubscribe method I am not having problems if I only subscribe the email address.

The problem arises when I try to pass through the "merge_vars" merge field. For example, if I use the "FNAME" and "LNAME" merge fields, I noticed that the email is being subscribed successfully but the FNAME and LNAME fields are not being populated!

 

        Dictionary<string, object> merge_vars = new Dictionary<string, object>();
        merge_vars.Add("FNAME", userName);
        merge_vars.Add("LNAME", firstName);

        listSubscribeParms param = new listSubscribeParms(listId, email, merge_vars);
        listSubscribeInput input = new listSubscribeInput(param);
        listSubscribe ls = new listSubscribe(input);
        
        listSubscribeOutput output = ls.Execute(input);

 

After some headaches I tried the "listMemberInfo" method and I saw that the values keys for de username and lastname, returned in the listMemberInfoOutput object, were of the form "MERGE1" and MERGE2 respectively.

So I tried this code and Worked!

        Dictionary<string, object> merge_vars = new Dictionary<string, object>();
        merge_vars.Add("MERGE1", userName);
        merge_vars.Add("MERGE2", firstName);

        listSubscribeParms param = new listSubscribeParms(listId, email, merge_vars);
        listSubscribeInput input = new listSubscribeInput(param);
        listSubscribe ls = new listSubscribe(input);
        
        listSubscribeOutput output = ls.Execute(input);

Somebody knows what is going on here?

 

Thanks!

BS.

Coordinator
Feb 6, 2011 at 8:47 PM

The only thing that comes to mind is that FNAME & LNAME are not the actual tag names.

Occasionally I catch myself trying to use the field LABEL and not the TAG, which doesn't work of course.

Other than that, I can't think why it didn't work.

 

dbm

Mar 17, 2011 at 8:50 PM

This worked for me.

Dim li As New listSubscribeInput()

li.parms.merge_vars.Add("FNAME", txtFName.text)
li.parms.merge_vars.Add("LNAME", txtLName.Text)
li.parms.merge_vars.Add("DLNK", downloadLink)
li.parms.send_welcome = True
Dim t As New listSubscribe(li)
Dim op As listSubscribeOutput = t.Execute()