Santi
unread,Dec 15, 2009, 8:56:08 PM12/15/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MailChimp API Discuss
Here is my sample code, hope it helps somebody.
Dim apikey
Dim listid
Dim MCURL
'Define these variables.
Function listSubscribe (strEmail, strFirstName, strLastName, strPhone)
Dim resp
Dim merge_vars
Dim ParamArr
Set merge_vars = Server.CreateObject("Scripting.Dictionary")
With merge_vars
.Add "OPTINIP", Request.ServerVariables("REMOTE_ADDR")
.Add "double_optin", False
.Add "FNAME", strFirstName
.Add "LNAME", strLastName
.Add "phone", strPhone
End With
'Function Reference: listSubscribe(string apikey, string id, string
email_address, array merge_vars, string email_type, boolean
double_optin, boolean update_existing, boolean replace_interests,
boolean send_welcome)
'NOTE THAT EMPTY VALUES DO NOT WORK WELL WITH THIS VERSION OF
XLMRPC.ASP. BEST TO SEND EMPTY STRINGS.
ParamArr = array
(apikey,listid,strEmail,merge_vars,"",True,True,True,True)
resp = xmlRPC(MCURL,"listSubscribe",ParamArr)
'Uncomment below for Error Checking
'Response.Write(Session("xmltxt")&"<br>")
'Response.Write(Session("ServerResponseText")&"<br>")
LGNListSubscribe = resp
End Function