10

I'm referring to this page in the API documentation when trying to programatically create content for a MailChimp campaign. I have the following section in my template and I'm trying to change its content:

<td mc:edit="body">To be replaced by API</td>

and here is the JSON request:

{"template":{"id":"170189","sections":{"body":"testing content"}}}

But the content isn't being changed! Everything else is working, eg template 170189 is being loaded into the campaign. Any hints?

ekad
  • 14,436
  • 26
  • 44
  • 46
Joe Bligh
  • 131
  • 1
  • 6
  • Do you have any other sections named `body`? Those need to be unique. Have you reached out to MailChimp's API support team? Does the string "To be replaced by API" still exist in the campaign or is it blank? – TooMuchPete Nov 24 '15 at 21:18
  • That was the only section named body, and yes I'm in touch with support. And yes, that string did still exist. So the campaign is created, with the correct template chosen, and if I PUT the plain HTML (ie {"html":"testing content"}) that overrides the entire campaign as expected, but individual template section overrides are just not happening! – Joe Bligh Nov 30 '15 at 09:59
  • Did you ever get this working? Maybe try naming the section something other than "body", since that might be considered a reserved word by MailChimp's code. Something unique to you and your template ("joeblighsection1"?). – stone Jan 05 '16 at 21:39
  • Not yet - I got in touch with Mailchimp's support team and they said this is a bug with the API that their developers are working on. I'll keep checking in with them until it's fixed. They have suggested sending a GET for the campaign after PUTting it, which apparently forces the API to update the campaign, but I haven't tried this yet. Will try and let you know. – Joe Bligh Jan 11 '16 at 17:30

1 Answers1

3

Fixed - mc:edit sections won't be updated by the API if they sit within a mc:repeatable!

Joe Bligh
  • 131
  • 1
  • 6