<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Synclab Consulting</title>
	<atom:link href="http://www.synclab.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.synclab.com</link>
	<description>Recommendation Systems for Intelligent Websites</description>
	<lastBuildDate>Tue, 26 Apr 2011 13:02:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Facebook is a Facebook App&#8217;s Own Worst Enemy</title>
		<link>http://www.synclab.com/facebook-is-a-facebook-apps-own-worst-enemy/</link>
		<comments>http://www.synclab.com/facebook-is-a-facebook-apps-own-worst-enemy/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 13:01:49 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Social Media]]></category>

		<guid isPermaLink="false">http://www.synclab.com/?p=137</guid>
		<description><![CDATA[As a developer who builds businesses based on Facebook&#8217;s Open Graph platform, I am seeing a disturbing trend. With one hand Facebook is encouraging entrepreneurs to create companies built on Facebook Apps. With the other hand Facebook is usurping the best ideas and creating its own products to compete with those same companies. When Facebook [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer who builds businesses based on Facebook&#8217;s Open Graph platform, I am seeing a disturbing trend. With one hand Facebook is encouraging entrepreneurs to create companies built on Facebook Apps. With the other hand Facebook is usurping the best ideas and creating its own products to compete with those same companies. When Facebook takes these ideas and integrates them into its own product offering, Facebook has advantages and access to core features that weren&#8217;t available to the original developers. Facebook isn&#8217;t playing nicely with the very developers that are helping to grow Facebook&#8217;s customer base.</p>
<p>Two prominent examples of this practice are Foursquare and Groupon. Foursquare is a location-based Facebook App that allows users to &#8220;check in&#8221; to businesses like restaurants and bars using mobile devices. Foursquare&#8217;s application became very successful, growing to over 6 million users worldwide in 2010. In late 2010, Facebook announced a competing product, Facebook Places. Just two months after launch, Facebook Places had over 30 million registered users.</p>
<p>Groupon is an innovative, localized deal-of-the-day website that had 35 million registered users as of late 2010. A significant portion of the Groupon business model is the ability to share these deals of the day over social networks like Facebook. Today, Facebook announced the limited launch of Facebook Deals, a product that competes directly with Groupon&#8217;s core offering.</p>
<p>What Facebook is saying to developers by these actions is that you can be successful by building businesses using our platform, but if you get too successful, we are going to take your ideas and compete with you. That doesn&#8217;t seem like a good message to send to developers. After all it is companies like Groupon, LivingSocial, and Foursquare that are showing to investors how Facebook can be a truly powerful marketing machine and not just toy for relationship statuses. </p>
<p>Just a few months ago Facebook raised $500 million from Goldman Sachs. The company has plenty of cash on hand. While it&#8217;s probably too late to purchase Groupon, who turned down $6 billion from Google, why not buy up budding businesses like Foursquare instead of competing with them? This would send a much better message to Facebook App developers.  Small companies would be encouraged to continue innovating using the Facebook Open Graph platform instead of looking over their shoulder to see when Facebook was going to come along and squash their business.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synclab.com/facebook-is-a-facebook-apps-own-worst-enemy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hooks a Winner at Constant Contact</title>
		<link>http://www.synclab.com/hooks-a-winner-at-constant-contact/</link>
		<comments>http://www.synclab.com/hooks-a-winner-at-constant-contact/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 19:48:18 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Hooks]]></category>

		<guid isPermaLink="false">http://www.synclab.com/?p=108</guid>
		<description><![CDATA[We are delighted to announce that Hooks for Facebook has placed 3rd in the Constant Contact Developer Challenge. Specifically, Hooks placed in the Social Media category due to our integration with Facebook. The competition was certainly tough and we are very proud to have been honored by the judges. We want to thank Constant Contact [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.constantcontact.com/developer-challenge/winners.jsp"><img src="http://www.synclab.com/wp-content/uploads/2010/12/MarketPlaceLogo.gif" alt="" title="Constant Contact Marketplace" width="268" height="70" class="alignright size-full wp-image-109" /></a>We are delighted to announce that Hooks for Facebook has placed 3rd in the <a href="http://www.constantcontact.com/developer-challenge/winners.jsp">Constant Contact Developer Challenge</a>. Specifically, Hooks placed in the Social Media category due to our integration with Facebook. The competition was certainly tough and we are very proud to have been honored by the judges.</p>
<p>We want to thank Constant Contact for running a great competition and congratulate the other winners in the competition.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synclab.com/hooks-a-winner-at-constant-contact/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring, JavaMailSender, and SMTP Authentication</title>
		<link>http://www.synclab.com/spring-javamailsender-and-smtp-authentication/</link>
		<comments>http://www.synclab.com/spring-javamailsender-and-smtp-authentication/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 01:23:31 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Constant Contact]]></category>
		<category><![CDATA[email delivery]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[spring framework]]></category>

		<guid isPermaLink="false">http://www.synclab.com/?p=84</guid>
		<description><![CDATA[Third-party SMTP relays are a necessary and cost effective way to ensure proper email delivery for critical communications. In the process of setting up an application to use CritSend, I learned a couple tricks with Spring and JavaMail.]]></description>
			<content:encoded><![CDATA[<p>When running a legitimate business that sends large amounts of email, it can be a real challenge to make sure these critical emails are delivered to a user&#8217;s Inbox. If your subscribers are actually paying you to send email on their behalf, the situation becomes even more precarious. It is certainly possible to run your own outbound mail server and to get excellent delivery. But to do so you have to be set up and manage things like SPF and DomainKeys entries in DNS, you must continually monitor your sender reputation, and you must act quickly to remove your server from any black lists. Most of all you must be vigilant about securing your mail server from malicious spammers who will use any vulnerability to ruin your hard-won reputation.</p>
<p>I have worked with businesses that send hundreds of thousands of legitimate emails per month. Some of these companies have employees who&#8217;s job function it is to monitor and guarantee delivery. Believe me this is a difficult, frustrating, and time-consuming job. For most small businesses it just does not make financial sense to dedicate personnel to this task. I recommend that my clients run their newsletters through paid services such as Constant Contact or AWebber. They handle all the dirty work and let you concentrate on the content.</p>
<p>However, for businesses who must send one-off emails such as notifications, password resets, and private messages, we have to look at third-party email senders. For a recent client I evaluated three: CritSend, MessageGears, and SMTP.com. All three could provide the volume of email (approx 10,000/month) they were sending for just a few hundred dollars a year. This is at least an order of magnitude cheaper than trying to maintain the reputation on a single mail server. And integration can be as simple as pointing your code to a new outbound SMTP server.</p>
<p>Well, at least I thought the integration was that simple. For this project I was using Spring and a JavaMailSenderImpl to direct mail to a SMTP server that required authentication. I learned two tricks that I think are useful enough to share.</p>
<p>My initial spring setup looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;critSendMailSender&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.mail.javamail.JavaMailSenderImpl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;smtp.critsend.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;port&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;587&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>This resulted in the rather cryptic error:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">451 Requested action aborted: local error in processing
com.sun.mail.smtp.SMTPSendFailedException: 451 Requested action aborted: local error in processing</pre></div></div>

<p>The first trick was to enable debugging for the SMTP connection:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;critSendMailSender&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.mail.javamail.JavaMailSenderImpl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;smtp.critsend.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;port&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;587&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;javaMailProperties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;mail.debug&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>The debugging gave me this information in standard out:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DEBUG SMTP: useEhlo true, useAuth false
DEBUG SMTP: trying to connect to host &quot;smtp.critsend.com&quot;, port 587, isSSL false
220 mail29.messaging-master.com NO UCE NO UBE NO RELAY PROBES ESMTP
DEBUG SMTP: connected to host &quot;smtp.critsend.com&quot;, port: 587
EHLO www2
250-mail29.messaging-master.com Hello nice to meet you
250 AUTH PLAIN CRAM-MD5 LOGIN
DEBUG SMTP: Found extension &quot;AUTH&quot;, arg &quot;PLAIN CRAM-MD5 LOGIN&quot;
DEBUG SMTP: use8bit false
MAIL FROM:&lt;...@...s.com&gt;
451 Requested action aborted: local error in processing</pre></div></div>

<p>Oops. Apparently just setting the username and password is not enough to tell JavaMail to use authentication. That lead to the second trick:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;bean</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;critSendMailSender&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.springframework.mail.javamail.JavaMailSenderImpl&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;host&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;smtp.critsend.com&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;port&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;587&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;username&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;javaMailProperties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;mail.debug&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
           <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;prop</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;mail.smtp.auth&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/prop<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/props<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/property<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/bean<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Success:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host &quot;smtp.critsend.com&quot;, port 587, isSSL false
220 mail29.messaging-master.com NO UCE NO UBE NO RELAY PROBES ESMTP
DEBUG SMTP: connected to host &quot;smtp.critsend.com&quot;, port: 587
EHLO www2
250-mail29.messaging-master.com Hello nice to meet you
250 AUTH PLAIN CRAM-MD5 LOGIN
DEBUG SMTP: Found extension &quot;AUTH&quot;, arg &quot;PLAIN CRAM-MD5 LOGIN&quot;
DEBUG SMTP: Attempt to authenticate
AUTH LOGIN
235 Authentication successful.
...
250 Delivery in progress
QUIT</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.synclab.com/spring-javamailsender-and-smtp-authentication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scheduling Repeating Campaigns with the Constant Contact API</title>
		<link>http://www.synclab.com/scheduling-repeating-campaigns-with-the-constant-contact-api/</link>
		<comments>http://www.synclab.com/scheduling-repeating-campaigns-with-the-constant-contact-api/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 01:08:21 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Constant Contact]]></category>
		<category><![CDATA[Hooks]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.synclab.com/?p=58</guid>
		<description><![CDATA[In this previous post I discussed how we used Constant Contact&#8217;s custom fields to create a weekly recommendation newsletter for Hooks containing content that is truly unique for each customer. Since only the content of the custom fields changes from week to week, the rest of the email can just be a static template. Originally [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.synclab.com/personalized-newsletter-content-with-the-constant-contact-api/">this previous post</a> I discussed how we used Constant Contact&#8217;s custom fields to create a weekly recommendation newsletter for Hooks containing content that is truly unique for each customer. Since only the content of the custom fields changes from week to week, the rest of the email can just be a static template. Originally I had planned to simply build a nice email using Constant Contact&#8217;s graphical design tools and resend that same email every week. Unfortunately, Constant Contact does not allow you to send the same campaign to the same subscribers multiple times. The solution we came up with instead was to make an XHTML template and use the Constant Contact API to create a new campaign from this template each week and schedule it to send.</p>
<p>The Constant Contact API Java Client that we used to set the custom fields did not include functionality for creating and scheduling campaigns. We could have probably extended the client to implement the missing features, but in this simple case it turned out to be easier to post XML directly to the API REST server.</p>
<p>The first piece of the puzzle was an XHTML version of the newsletter template containing all the custom fields formatted and positioned properly (as explained in the <a href="http://www.synclab.com/personalized-newsletter-content-with-the-constant-contact-api/">personalized newsletter post</a>). A sample is included as #1 below. The second was an XML document containing the XHTML template (properly escaped!) to be posted directly to the REST server. The values in the xml preceded by a $ were variables swapped in at runtime. For instance, $htmlContent was the escaped version of the XHTML template shown as #1. The third sample XML document was all that was needed to schedule the newly created campaign for sending. This is shown as #3 below. Finally, some Java code snippets to put this all together are shown as #4. Please note that this Java code is just for demonstration purposes. It is far from optimized, missing a lot of error handling, and not ready for production use. <em>Caveat emptor</em>.</p>
<p>1. XHTML version of the email template</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">xmlns:cctd</span>=<span style="color: #ff0000;">&quot;http://www.constantcontact.com/cctd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hooks for Facebook Recommendations<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;CopyRight<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        Copyright (c) 2010 Synclab Consulting LLC. All rights reserved.  Except as permitted under a separate written permission of Synclab Consulting LLC.  For inquiries regarding reproduction or distribution of any Constant Contact material, please contact support@hooks.synclab.com.
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/CopyRight<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OpenTracking</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #808080; font-style: italic;">&lt;!--  Do NOT delete previous line if you want to get statistics on the number of opened emails --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;600&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;6&quot;</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">valign</span>=<span style="color: #ff0000;">&quot;top&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;left&quot;</span> <span style="color: #000066;">colspan</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">rowspan</span>=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">valign</span>=<span style="color: #ff0000;">&quot;top&quot;</span> <span style="color: #000066;">bgcolor</span>=<span style="color: #ff0000;">&quot;#440e00&quot;</span> <span style="color: #000066;">colspan</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">rowspan</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;background-color: rgb(68, 14, 0); padding: 6px;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span>  <span style="color: #000066;">bgcolor</span>=<span style="color: #ff0000;">&quot;#ffffff&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">colspan</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;left&quot;</span> <span style="color: #000066;">valign</span>=<span style="color: #ff0000;">&quot;middle&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;font</span> <span style="color: #000066;">size</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">face</span>=<span style="color: #ff0000;">&quot;Impact,Verdana,Helvetica,sans-serif&quot;</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#ee8738&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;color: rgb(238, 135, 56); font-family: Impact,Verdana,Helvetica,sans-serif; font-size: 18pt;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Hooks for Facebook Music Recommendations<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/font<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;75&quot;</span> <span style="color: #000066;">vspace</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">hspace</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;75&quot;</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://hooks.synclab.com/hooks/images/facehooks_logo.gif&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;Hooks for Facebook&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">colspan</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://img.constantcontact.com/letters/images/1101093164665/news_band2_hdr1.jpg&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;Hooks for Facebook Banner&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">colspan</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;font</span> <span style="color: #000066;">color</span>=<span style="color: #ff0000;">&quot;#ee8738&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;color: rgb(238, 135, 56); font-family: Verdana,Helvetica,sans-serif; font-size: 12pt;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.FIRSTNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>, these are your customized music recommendations for $date.
                                        Recommendations are based on the music you rate and the music that your friends rate. To view all your recommendations or to update your
                                        settings, visit the <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SimpleURLProperty</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;hooksapplink&quot;</span> <span style="color: #000066;">track</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;plain&quot;</span> <span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;Hooks Application&quot;</span> <span style="color: #000066;">href</span>= <span style="color: #ff0000;">&quot;http://apps.facebook.com/myhooks&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> on Facebook.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/font<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;190&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;190&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT4&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;190&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT6&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;190&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT7&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT8&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;190&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT9&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT10&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;190&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT11&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT12&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span>  <span style="color: #000066;">bgcolor</span>=<span style="color: #ff0000;">&quot;#ffffff&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">border</span>=<span style="color: #ff0000;">&quot;0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">colspan</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tbody<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>2. XML for creating a campaign</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2005/Atom&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/ws/customers/$name/campaigns&quot;</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;edit&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://api.constantcontact.com/ws/customers/$name/campaigns<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>API Test Email<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;application/vnd.ctct+xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Campaign</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ws.constantcontact.com/ns/1.0/&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;http://api.constantcontact.com/ws/customers/$name/campaigns/1100546096289&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>API Test Email $date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Status<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Draft<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Status<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Date<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Subject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hooks Weekly Music Recommendations<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Subject<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;FromName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hooks for Facebook<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/FromName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ViewAsWebpage<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>NO<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ViewAsWebpage<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ViewAsWebpageLinkText<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/ViewAsWebpageLinkText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ViewAsWebpageText<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/ViewAsWebpageText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PermissionReminder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>NO<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PermissionReminder<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PermissionReminderText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PermissionReminderText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;GreetingSalutation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Dear<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/GreetingSalutation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;GreetingName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>FirstName<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/GreetingName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;GreetingString<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Greetings!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/GreetingString<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Synclab Consulting LLC<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OrganizationName<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationAddress1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>116 S Broad St<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OrganizationAddress1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationAddress2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Suite C<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OrganizationAddress2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationAddress3<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/OrganizationAddress3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationCity<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Kennett Square<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OrganizationCity<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationState<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>PA<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OrganizationState<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationInternationalState<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/OrganizationInternationalState<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationCountry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>us<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OrganizationCountry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;OrganizationPostalCode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>19348<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/OrganizationPostalCode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;IncludeForwardEmail<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>NO<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/IncludeForwardEmail<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ForwardEmailLinkText<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/ForwardEmailLinkText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;IncludeSubscribeLink<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>NO<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/IncludeSubscribeLink<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;SubscribeLinkText<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/SubscribeLinkText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EmailContentFormat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>XHTML<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EmailContentFormat<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EmailContent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$htmlContent<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EmailContent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EmailTextContent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #ddbb00;">&amp;lt;</span>Text&gt;$textContent<span style="color: #ddbb00;">&amp;lt;</span>/Text&gt;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EmailTextContent<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;StyleSheet<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/StyleSheet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ContactLists<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ContactList</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;http://api.constantcontact.com/ws/customers/$name/lists/2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2005/Atom&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/ws/customers/$name/lists/2&quot;</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;self&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ContactList<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ContactLists<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;FromEmail<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Email</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;http://api.constantcontact.com/ws/customers/$name/settings/emailaddresses/2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2005/Atom&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/ws/customers/$name/settings/emailaddresses/2&quot;</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;self&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EmailAddress<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>support@redacted.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EmailAddress<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/FromEmail<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ReplyToEmail<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Email</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;http://api.constantcontact.com/ws/customers/$name/settings/emailaddresses/2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
                    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2005/Atom&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/ws/customers/$name/settings/emailaddresses/2&quot;</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;self&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;EmailAddress<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>support@redacted.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/EmailAddress<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ReplyToEmail<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Campaign<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://api.constantcontact.com/ws/customers/$name/campaigns<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Campaigns for customer: $name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;campaigns&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;campaigns&quot;</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;self&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Hooks for Facebook<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$date<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>3. XML for scheduling the new campaign</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2005/Atom&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;/ws/customers/$name/campaigns/$campaignId/schedules/1&quot;</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;edit&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://api.constantcontact.com/ws/customers/$name/campaigns/$campaignId/schedules/1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>$title<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$updated<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$name<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;application/vnd.ctct+xml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Schedule</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ws.constantcontact.com/ns/1.0/&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;http://api.constantcontact.com/ws/customers/$name/campaigns/$campaignId/schedules/1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ScheduledTime<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>$scheduledDate<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ScheduledTime<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Schedule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>4. Java methods to post XML</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ctctlabs.ctctwsjavalib.CTCTConnection</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ctctlabs.ctctwsjavalib.Contact</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ctctlabs.ctctwsjavalib.ContactList</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.BufferedReader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.InputStreamReader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.text.DateFormat</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.text.SimpleDateFormat</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Date</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.HashMap</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.TimeZone</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.commons.lang.StringEscapeUtils</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.HttpResponse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.HttpStatus</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.ClientProtocolException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.client.methods.HttpPost</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.http.entity.ByteArrayEntity</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.log4j.Logger</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ConstantContactApiClient <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> apiKey <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;your api key&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> username <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;your username&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> password <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;your password&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> Logger logger <span style="color: #339933;">=</span> Logger.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span>ConstantContactApiClient.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> CTCTConnection getAuthenticatedConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ClientProtocolException, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        CTCTConnection conn <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CTCTConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        conn.<span style="color: #006633;">authenticate</span><span style="color: #009900;">&#40;</span>apiKey, username, password<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> conn<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Creates a campaign using the html and text content passed in. Returns the ID of the new campaign.
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> createCampaign<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> htmlContent, <span style="color: #003399;">String</span> textContent<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">DateFormat</span> dfa <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">SimpleDateFormat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;yyyy-MM-dd'T'HH:mm:ss.S'Z'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">TimeZone</span> T1 <span style="color: #339933;">=</span> <span style="color: #003399;">TimeZone</span>.<span style="color: #006633;">getTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;GMT&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// set the time zone of the converted date to GMT</span>
        dfa.<span style="color: #006633;">setTimeZone</span><span style="color: #009900;">&#40;</span>T1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">Date</span> now <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        now.<span style="color: #006633;">setTime</span><span style="color: #009900;">&#40;</span>now.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> 60000l<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> date <span style="color: #339933;">=</span> dfa.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span>now<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">StringBuffer</span> fileData <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">StringBuffer</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">BufferedReader</span> reader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getClassLoader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getResourceAsStream</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;campaign_request.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> buf <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> numRead <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>numRead <span style="color: #339933;">=</span> reader.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>buf<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">String</span> readData <span style="color: #339933;">=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>buf, <span style="color: #cc66cc;">0</span>, numRead<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            fileData.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span>readData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            buf <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        reader.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> xml <span style="color: #339933;">=</span> fileData.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$date&quot;</span>, date<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$htmlContent&quot;</span>, StringEscapeUtils.<span style="color: #006633;">escapeHtml</span><span style="color: #009900;">&#40;</span>htmlContent<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$textContent&quot;</span>, StringEscapeUtils.<span style="color: #006633;">escapeHtml</span><span style="color: #009900;">&#40;</span>textContent<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$name&quot;</span>, username<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span>xml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        HttpPost httppost <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HttpPost<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;https://api.constantcontact.com/ws/customers/&quot;</span> <span style="color: #339933;">+</span> username <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/campaigns&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        httppost.<span style="color: #006633;">addHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span>, <span style="color: #0000ff;">&quot;application/atom+xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        ByteArrayEntity entity <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ByteArrayEntity<span style="color: #009900;">&#40;</span>xml.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        httppost.<span style="color: #006633;">setEntity</span><span style="color: #009900;">&#40;</span>entity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        HttpResponse response <span style="color: #339933;">=</span> getAuthenticatedConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHttpclient</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>httppost<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span>response.<span style="color: #006633;">getStatusLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">InputStreamReader</span> r <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span>response.<span style="color: #006633;">getEntity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">BufferedReader</span> br <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> line <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> id <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>line <span style="color: #339933;">=</span> br.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>id <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span>line.<span style="color: #006633;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">startsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;id&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> line.<span style="color: #006633;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;campaigns/&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                id <span style="color: #339933;">=</span> line.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span>i <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;campaigns/&quot;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, line.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">&quot;&lt;/id&gt;&quot;</span>.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
        br.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        <span style="color: #000066; font-weight: bold;">int</span> status <span style="color: #339933;">=</span> response.<span style="color: #006633;">getStatusLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getStatusCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">return</span> id<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
      * Schedules the campaign described by campaignId to send on scheduleDate.
      */</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> scheduleCampaign<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> campaignId, <span style="color: #003399;">Date</span> scheduleDate<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #008000; font-style: italic; font-weight: bold;">/**
         * &lt;year&gt;-&lt;month&gt;-&lt;day&gt;T&lt;hour&gt;:&lt;min&gt;:&lt;sec&gt;.&lt;milliseconds&gt;Z
         *  Example: 2009-12-04T21:14:12.827Z
         */</span>
        <span style="color: #003399;">DateFormat</span> dfa <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">SimpleDateFormat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;yyyy-MM-dd'T'HH:mm:ss.S'Z'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">DateFormat</span> dfb <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">SimpleDateFormat</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;yyyy-MM-dd'T'HH:mm:ss'Z'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">TimeZone</span> T1 <span style="color: #339933;">=</span> <span style="color: #003399;">TimeZone</span>.<span style="color: #006633;">getTimeZone</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;GMT&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// set the time zone of the converted date to GMT</span>
        dfa.<span style="color: #006633;">setTimeZone</span><span style="color: #009900;">&#40;</span>T1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        dfb.<span style="color: #006633;">setTimeZone</span><span style="color: #009900;">&#40;</span>T1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">Date</span> now <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Date</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        now.<span style="color: #006633;">setTime</span><span style="color: #009900;">&#40;</span>now.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> 60000l<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        scheduleDate.<span style="color: #006633;">setTime</span><span style="color: #009900;">&#40;</span>scheduleDate.<span style="color: #006633;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> 60000l<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> updated <span style="color: #339933;">=</span> dfa.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span>now<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> title <span style="color: #339933;">=</span> dfb.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span>scheduleDate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> scheduledDate <span style="color: #339933;">=</span> dfa.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span>scheduleDate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">StringBuffer</span> fileData <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">StringBuffer</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">BufferedReader</span> reader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getClassLoader</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getResourceAsStream</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;schedule_request.xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> buf <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> numRead <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>numRead <span style="color: #339933;">=</span> reader.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>buf<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #003399;">String</span> readData <span style="color: #339933;">=</span> <span style="color: #003399;">String</span>.<span style="color: #006633;">valueOf</span><span style="color: #009900;">&#40;</span>buf, <span style="color: #cc66cc;">0</span>, numRead<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            fileData.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span>readData<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            buf <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #000066; font-weight: bold;">char</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1024</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        reader.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        <span style="color: #003399;">String</span> xml <span style="color: #339933;">=</span> fileData.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$updated&quot;</span>, updated<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$title&quot;</span>, title<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$scheduledDate&quot;</span>, scheduledDate<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$campaignId&quot;</span>, campaignId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        xml <span style="color: #339933;">=</span> xml.<span style="color: #006633;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;$name&quot;</span>, username<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span>xml<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        HttpPost httppost <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HttpPost<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;https://api.constantcontact.com/ws/customers/&quot;</span> <span style="color: #339933;">+</span> username <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/campaigns/&quot;</span> <span style="color: #339933;">+</span> campaignId <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;/schedules&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        httppost.<span style="color: #006633;">addHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span>, <span style="color: #0000ff;">&quot;application/atom+xml&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        ByteArrayEntity entity <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ByteArrayEntity<span style="color: #009900;">&#40;</span>xml.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        httppost.<span style="color: #006633;">setEntity</span><span style="color: #009900;">&#40;</span>entity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        HttpResponse response <span style="color: #339933;">=</span> getAuthenticatedConnection<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getHttpclient</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>httppost<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span>response.<span style="color: #006633;">getStatusLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">InputStreamReader</span> r <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">InputStreamReader</span><span style="color: #009900;">&#40;</span>response.<span style="color: #006633;">getEntity</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">BufferedReader</span> br <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">BufferedReader</span><span style="color: #009900;">&#40;</span>r<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> line <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>line <span style="color: #339933;">=</span> br.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            logger.<span style="color: #006633;">debug</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        br.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
        <span style="color: #000066; font-weight: bold;">int</span> status <span style="color: #339933;">=</span> response.<span style="color: #006633;">getStatusLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getStatusCode</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>status <span style="color: #339933;">==</span> HttpStatus.<span style="color: #006633;">SC_CREATED</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            logger.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;campaign scheduled for &quot;</span> <span style="color: #339933;">+</span> scheduleDate.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            logger.<span style="color: #006633;">warn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;unable to schedule campaign&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.synclab.com/scheduling-repeating-campaigns-with-the-constant-contact-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Personalized Newsletter Content with the Constant Contact API</title>
		<link>http://www.synclab.com/personalized-newsletter-content-with-the-constant-contact-api/</link>
		<comments>http://www.synclab.com/personalized-newsletter-content-with-the-constant-contact-api/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 19:37:07 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Constant Contact]]></category>
		<category><![CDATA[Hooks]]></category>

		<guid isPermaLink="false">http://www.synclab.com/?p=48</guid>
		<description><![CDATA[One of the greatest challenges with an application like Hooks is to keep users coming back to the site to update their recommendations. Without updated recommendations, the data in Hooks quickly goes stale. To encourage users to log back in to the Hooks for Facebook application on a weekly basis, we are relying on an [...]]]></description>
			<content:encoded><![CDATA[<p>One of the greatest challenges with an application like Hooks is to keep users coming back to the site to update their recommendations. Without updated recommendations, the data in Hooks quickly goes stale. To encourage users to log back in to the Hooks for Facebook application on a weekly basis, we are relying on an engaging, personalized newsletter</p>
<p>Maintaining an email list, managing subscriptions, and sending out customized emails are certainly features that we could have programmed directly into Hooks. But maintaining IP addresses with good enough of a sending reputation to get delivery into the inbox at the all the major ISPs is a time consuming and ongoing job. If you are a bulk mail sender, you have to really stay on top of your reputation by constantly monitoring black lists and delivery statistics. Since that is not our core business, we found much greater value in outsourcing all that functionality. Constant Contact provides an API that allows programs like Hooks to interact directly with the email lists in our account and to schedule and send emails automatically. Since the email goes out from Constant Contact&#8217;s servers, we are not stuck with the chore of policing our outbound IP email reputation. Best of all the service is quite affordable.</p>
<div id="attachment_19" class="wp-caption alignleft" style="width: 310px"><a href="http://www.synclab.com/wp-content/uploads/2010/11/newsletter-sample.png"><img class="size-medium wp-image-19" title="Hooks Newsletter Sample" src="http://www.synclab.com/wp-content/uploads/2010/11/newsletter-sample-300x277.png" alt="" width="300" height="277" /></a><p class="wp-caption-text">Hooks Newsletter Prototype</p></div>
<p>The ultimate goal was to create a weekly newsletter that would look something like the image to the left. Hooks is written in Java, so we started with the <a href="http://sourceforge.net/projects/ctctwsjavalib/" target="_blank">CTCT Webservice Java Client Library</a> available on SourceForge. With just a few enhancements to the Contact.java class to bring in the CustomField1 &#8211; CustomField15 attributes, we were able to connect to the REST API and update custom fields for the newsletter subscribers.</p>
<p>We did however run into a couple challenges, the solutions to which I think are worth sharing in this blog. The first challenge was that we wanted to send customized recommendations out to each recipient. This meant that each recipient should have a block of HTML containing images and links unique to that recipient. In our initial implementation, we thought we could just cram an arbitrary block of HTML into a custom field and drop that custom field into the newsletter template. Then we would simply loop through each recipient and set the custom field HTML block each week to the updated values. Unfortunately, it turns out that <em>each custom field only allowed 50 characters</em>. Most HTML tags containing URLs are much longer than that. So we had to get a little creative.</p>
<p>The second challenge was that we wanted to send the same basic newsletter each week and simply swap out the content area. We thought we could just design a newsletter using Constant Contact&#8217;s nice GUI email design tools and templates and then send this same email over and over again. However, Constant Contact simply is not set up to work that way, forcing us to come up with an alternate solution. The solution to this second challenge is covered here.</p>
<h4>Getting Per-Recipient HTML Images and Links Into a Constant Contact Campaign using Custom Fields</h4>
<p>Since each custom field could only hold 50 characters, we realized we would have to break up the HTML into fragments and then stack custom fields together that would then ultimately render properly. An example is the easiest way to explain this.<br />
Each final recommendations should look as follows in the newsletter:</p>
<div align="center">
<img src="http://a1.phobos.apple.com/us/r1000/018/Music/75/66/b9/mzi.apkiohpl.100x100-75.jpg" alt="Hooks Recommendation" /><br />
<a href="http://hooks.synclab.com/track/303463582" target="_blank">Train Song</a>
</div>
<p>This would require tags to look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;http://a1.phobos.apple.com/us/r1000/018/Music/75/66/b9/mzi.apkiohpl.100x100-75.jpg&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;Hooks Recommendation&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://hooks.synclab.com/track/303463582&quot;</span> <span style="color: #000066;">target</span>=<span style="color: #ff0000;">&quot;_blank&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Train Song<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>We finally settled on a solution using the CTCT subscriber fields in an XHTML email as follows and assigning the appropriate snippets to each field:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Since we wanted to include 6 recommendations, we repeated this procedure 6 times in the email template. An additional complication was that there are only 15 custom fields available for each recipient. Fortunately, some of the HTML code portions are the same for each recommendation tile. For these &#8220;constant&#8221; portions we utilized subscriber fields that we were not using elsewhere (e.g. Subscriber.COMPANYNAME and Subscriber.ADDRESSLINE1). This way we only used 2 custom fields per recommendation tile instead of 5. For example, the second tile would look like</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT3&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT4&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>and the third like</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.COMPANYNAME&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT5&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;subscriber.ADDRESSLINE1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.ADDRESSLINE2&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Subscriber.CUSTOMTEXT6&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The solution to the second challenge is presented in this <a href="http://www.synclab.com/scheduling-repeating-campaigns-with-the-constant-contact-api/">followup blog post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synclab.com/personalized-newsletter-content-with-the-constant-contact-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hooks Integrates with Constant Contact</title>
		<link>http://www.synclab.com/hooks-integrates-with-constant-contact/</link>
		<comments>http://www.synclab.com/hooks-integrates-with-constant-contact/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 20:13:57 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Hooks for Facebook]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Collaborative Filtering]]></category>
		<category><![CDATA[Constant Contact]]></category>
		<category><![CDATA[Hooks]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.synclab.com/?p=16</guid>
		<description><![CDATA[Hooks for Facebook now integrates with Constant Contact to send users weekly newsletters containing personalized music recommendations.]]></description>
			<content:encoded><![CDATA[<p>Hooks for Facebook can now deliver customized music recommendations straight to your inbox. Once a week Hooks compiles the latest recommendations for every user and sends them out as a customized email to each participating user. In addition to being personalized, the recommendations are genre specific. So users who choose Rock as their preferred genre will only receive rock recommendations.</p>
<p>As always, Hooks learns from how you rate music in the application. So if you don&#8217;t like the recommendations being generated, simply give low ratings to the songs you dislike and Hooks will recalculate your preferences.</p>
<p>This personalized email marketing is done through integration with the <a href="http://developer.constantcontact.com">Constant Contact API</a>. By using the Constant Contact REST API, Hooks can automatically create and schedule email campaigns with personalized custom fields for each recipient. A sample of the Hooks recommended music newsletter is show below.</p>
<p><a href="http://www.synclab.com/wp-content/uploads/2010/11/newsletter-sample.png"><img class="alignnone size-full wp-image-19" title="Hooks Newsletter Sample" src="http://www.synclab.com/wp-content/uploads/2010/11/newsletter-sample.png" alt="" width="630" height="582" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.synclab.com/hooks-integrates-with-constant-contact/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New &#8220;Friends&#8221; Feature Available in Hooks for Facebook</title>
		<link>http://www.synclab.com/new-friends-feature-available-in-hooks-for-facebook/</link>
		<comments>http://www.synclab.com/new-friends-feature-available-in-hooks-for-facebook/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 18:43:59 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Hooks for Facebook]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Collaborative Filtering]]></category>
		<category><![CDATA[Hooks]]></category>

		<guid isPermaLink="false">http://www.synclab.com/?p=5</guid>
		<description><![CDATA[The newest release of Hooks for Facebook a social music recommendation application now features a "Friends" tab. This new tab allows you to browse and preview the music that your friends have recently rated.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.synclab.com/wp-content/uploads/2010/11/hooks.png"><img class="size-full wp-image-7 alignleft" title="Hooks Logo" src="http://www.synclab.com/wp-content/uploads/2010/11/hooks.png" alt="" width="75" height="75" /></a>Hooks for Facebook is designed specifically to recommend music to you based primarily on music that your friends like. After all, aren&#8217;t we more likely to have common musical interests with our friends than with people we don&#8217;t know? The newest release of <a href="http://hooks.synclab.com/">Hooks for Facebook</a> now features a &#8220;Friends&#8221; tab to make this clearer than ever. This new tab allows you to browse and preview the music that your friends have recently rated. This is a great way to spy on what music your friends like and dislike as well as to get some insight on where your recommendations are coming from.</p>
<p>Naturally, not everyone wants their friends snooping around in their music reviews. As always, we respect this and give users an easy way to opt out of this feature with a simple click in the Settings tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.synclab.com/new-friends-feature-available-in-hooks-for-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

