How to set editable image in MailChimp template via API

Viewed 1154

I made a template with an editable image ("Editable Content Area"), like so:

<img src="http://somewhere.com/foo.jpg" mc:edit="header_image">

When making a new campaign I can replace the image while using the MailChimp editor. But I don't seem to be able to replace the image using the API.

If I include the URL to the image as the section content, it seems to be ignored and the campaign is created without the new image url being set.

    content: {
      sections: {
        header_image: "http://somewhere/else/bar.jpg",
        header: "Our latest newsletter",
        body: "<p>My fabulous content</p>",
        ... other named mc:edit section content ...
      }
    }

All other editable sections (text) are being properly replaced.

Question: How can I set the url of an mc:edit tagged image via the campaigns/create API?

1 Answers
Related