Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mailchimp 3.0 Get template in html form

Is there a way to get the actual html file in Mailchimp API 3.0? I tried this method, /3.0/templates/{template-Id}?apikey={myAPIkey} but it's not returning the actual file, it's giving me the thumbnail of the template.

like image 418
TheDevGirl Avatar asked Mar 25 '16 14:03

TheDevGirl


2 Answers

There is currently no single API call to get the HTML source for a template as there is in API 2.0. Below is the reply I got from MailChimp support on December 9th, 2016:

Thanks for reaching out to us with your question. At this time, API 3.0 does not contain a direct corollary that allows for the "source" of a Template to be retrieved. However, we are continuing to update the 3.0 version of the API in hopes of achieving parity with 2.0, so I will be passing this feedback along internally to our team. In the meantime, the only workaround available for retrieving the HTML in the same format would be to create a Campaign using the Template in question and then retrieve the source using the /campaigns/{campaign_id}/content endpoint.

like image 175
Dirk Wessels Avatar answered Oct 24 '22 09:10

Dirk Wessels


I solved this by update campaign content with template id and sections.

  1. Get template id link
  2. Get template section link
  3. Update id and sections in template object in campaign content link
like image 44
Hrvoje Avatar answered Oct 24 '22 07:10

Hrvoje