ePublishing/exact_target — Issue #4: Ampersand breaks email_add method
Author: broseborough
Created: 2012-02-09 17:01:43+00:00
State: open

Any time I use email_add I get an error saying that A CDATA section was not closed.
I tried to create the simplest possible example that reproduces the issue, and I have isolated the problem to the ampersand character (&) in the body.
It looks like this in irb after i have configured the ExactTarget class:

`>> email_id = ExactTarget.email_add('Title', 'Subject', :body=>'

')
ExactTarget::Error: ExactTarget error #39: XML Parse Error = Error!!! Error Code = -1072896668,
Line Number = 1, Reason = A CDATA section was not closed.
, API Call:MyUsername
MyPasswordemail
addHTMLPaste Title
Subject
<html><body>
from /Library/Ruby/Gems/1.8/gems/exact-target-0.0.5/lib/exact_target.rb:111:in `parse_response_xml'
from /Library/Ruby/Gems/1.8/gems/exact-target-0.0.5/lib/exact_target.rb:67:in `call'
from /Library/Ruby/Gems/1.8/gems/exact-target-0.0.5/lib/exact_target.rb:90:in `email_add'
from (irb):6`