Classic ASP with XLM-RPC

40 views
Skip to first unread message

Santi

unread,
Dec 15, 2009, 3:03:33 PM12/15/09
to MailChimp API Discuss
Hi,

For whoever is working on Classic ASP integration, I highly recommend
to use aspxlmrpc found at http://sourceforge.net/projects/aspxmlrpc/
All that is necessary to make it work with Option Explicit is to Dim 3
variables and to comment out vbNothing in the code.

It accepts dictionaries and Recordsets, really easy to go with it.

Santi

unread,
Dec 15, 2009, 8:56:08 PM12/15/09
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
Reply all
Reply to author
Forward
0 new messages