ColdFusion Sendy API Subscribe

Adding an email to your Sendy list is extremely simple using Sendy's API.
<!--- THE HTML --->
<form action="/components/email.cfc?method=subscribe" method="POST">
	<input type="email" name="email" placeholder="Enter email address">

<!--- The ColdFusion Function --->
<cffunction name="subscribe" access="remote" returnformat="plain" returntype="string" output="false">
	<cfargument name="email" required="true" type="string">
	<cfset var listId = "YOUR_ENCRYPTED_LIST_ID">
	<cfhttp method="POST" url="http://YOUR_SENDY_URL/subscribe">
		<cfhttpparam name="email" value="" type="formfield">
		<cfhttpparam name="list" value="#listId#" type="formfield">
		<cfhttpparam name="boolean" value="true" type="formfield">
	<!--- redirect back to page --->
	<cflocation url="/optin.php?msg=#cfhttp.FileContent#">
Posted by
Snippet Viewed 9061 times.

Share your ColdFusion code snippets:

  • Get some recognition & link back to your site.


Submit | Browse

Most Recent coldfusion snippets

Most Viewed