PHP Code Sample isn't encoding HTML chars properly


PHP Code Sample isn't encoding HTML chars properly

I've copied the PHP code sample for creating a new campaign, and overall the process seems to work as intended.


However, I'm having trouble when copy/pasting my HTML template code into the editor box, and submitting it as an edited campaign - although it passes all of the values properly, when I look at the message in CC itself, all of the quote and double quote characters are preceeded by a slash - which then breaks the design.


How can I pass the HTML I've built into the new campaign, while preserving the characters?


Hey Nancy,


If I understand you correctly, you would need to use html Entities.  Can you please post an example of your post so I can see what we are working with?

Ryan Davis
Quality Engineer

Ok, I had the html entity encoding in place, but I added stripslashes() to the XML output. That seems to have fixed the problem.

Developer Portal

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

Visit Page