We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

Invalid XHTML content - valid in Advanced Editor


Invalid XHTML content - valid in Advanced Editor



I created a template in the Advanced Editor and confirmed that the campaign sent and was received successfully.

I copied that code exactly, but when sending the same through the API it responds with


json.field.text_content.value.invalid:#/text_content: Value should be wrapped in <text> and </text> tags when email_content_format is XHTML.


I imagine this is a generic/catch-all error, as the template does not have any input fields, just tables, images and Property tags.


I can PM the code to a mod if required.


This error is not about the HTML version (email_content field), this is about the text version of your email content.  The text version is required to be wrapped in <text>{your content here}</text> fields.  The UI will add those fields automatically if the user does not remember to put them in.  We have chosen in the API to not automatically change any requests or modify any requests and instead always explicitely tell the developer what the issues are so they can make the choice to fix them.  If you wrap your text_content node with those XML tags, you should get passed that error.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

View API documentation, code samples, get your API key.

Visit Page