I struggled with this for several days using the template manager in MailChimp. The only way I worked was to export an existing template, add the mc: edit tag to the code, and then load it as a custom template.
Exporting a Template from MailChimp
- Go to the Templates section
- Click the "Edit" arrow next to the template you want to use with the API
- Select "Export HTML"
Upload a template to MailChimp
- Go to the Templates section
- Click the "Create Template" button in the upper right corner.
- Click "Code Your Own"
- Then select "Import html"
Example code of my template:
<div mc:edit="eventmessage"> Custom Event Message (replaced by API Call) <br></div>
As a check, I could now see that the section now appears when using the / templates / info call
Once I confirmed that Mailchimp saw the template section, I used the / campaigns / create call, as mentioned above, but skipped the html definition.
Updated campaign / creation (content / sections):
}, "content": { "sections": { "eventmessage": "Event Message Content" }, },
greggturnbull
source share