Emma Remote Signup API with ASP

Emma (or is it MyEmma?) is a neat little web based email marketing and communication service that competes with the larger, more well known email marketing services like ConstantContact.

In addition to their regular services, Emma also offers a Remote Signup feature which allows you to build a sign up form on your own website instead of relying on Emma's built-in solutions. This is a really useful feature if you're already collecting customer information and would like to simultaneously add them to your Emma mailing lists.

Emma provides sample PHP code using Pear and cURL, but no ASP solution. Here's an "undocumented" way to get their Remote Signup API working with Classic ASP. Just replace USERNAME, PASSWORD, SIGNUP_POST, ACCOUNT_ID and GROUP_NUMBER with actual values that are provided by EMMA.

ASP Source Code
<%
	dim stringPost
	stringPost = "username=USERNAME&password=PASSWORD" &_ 
		"&signup_post=SIGNUP_POST&emma_account_id=ACCOUNT_ID" &_
		"&group[GROUP_NUMBER]=1" &_
		"&emma_member_name_first=Test&emma_member_email=test@test.com"

	dim xmlhttp
	set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
	xmlhttp.Open "POST","https://app.e2ma.net/app/view:RemoteSignup",false
	xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
	xmlhttp.send stringPost

	dim stringResult
	stringResult = xmlhttp.responseText

	Set xmlhttp = nothing
%>
To print/access the response code, use
<%
	Response.Write stringResult
%>
Interesting factoid: Emma at one point did provide a sample ASP implementation, but it 1) had a bug; and 2) did not work. I played around with it, got it working, and submitted it back to Emma . I got the following reply from their technical support:

"Thanks for sending that along. I passed it to our developers, and they liked this solution. If it's okay with you, we are going to use this as part of our documentation in the future for new Remote Signup users."

Sadly, they still haven't included it in their documentation.

Comments

This is exactly what I am looking for…What action do I put in the form code to utilize this code?

J
Friday July 1, 2011

Say Something


 

Hello

My name is Tariq. I am a twenty something website developer based in Toronto, Canada, working at kanetix doing what I love to do. Yeppers, I like turtles and get on (the TTC) daily.

Popular Posts

Subscribe

RSS Feed