The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

Invalid XHTML content - valid in Advanced Editor

Regular Visitor

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.


Re: Invalid XHTML content - valid in Advanced Editor

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

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More