campaignUpdateInput template_id

Jul 1, 2010 at 7:47 PM

I'm using transactional campaigns and I need to update a campaign's subject and template_id.
So I have 1 campaign and multiple templates

Currently I have this

campaignUpdateInput input = new campaignUpdateInput(
                "MY MAILCHIMP KEY"
campaignUpdate update = new campaignUpdate(input);
campaignUpdateOutput output = update.Execute();

I call this twice for 2 name value pairs:
name="subject", value="my subject"
name="template_id", value=12345

The subject always changes; however, the template_id doesn't appear to work because it sends the same template no matter what template_id is sent to MailChimp. 

I think that instead of calling the same method twice to do the same thing, I need to send both pairs at once but I'm not sure how to do that. I receive no errors (I'm trapping them) and I've confirmed the template_id's are correct. Also the campaign sends fine, with multiple merge fields, just with the wrong template.

Jul 2, 2010 at 5:26 PM

Reading the 1.2 API it says: 
If you set template_id, you need to follow that up by setting it's 

So that would explain why I can't get to work. But how to I set the 
content to what already exists in the template? I'm not interested in 
overwriting content, just choosing a template to use for the campaign. 


Jul 20, 2010 at 9:41 PM

Sorry, I was on vacation when you posted this -- and I'm just catching up.

Did you ever get this resolved?


Jul 20, 2010 at 11:23 PM
Hi David, no problem. I got help over at the MailChimp Google group. It had nothing to do with PerceptiveMCAPI, it's just the way MailChimp API works. I had to replace a section of the template only to force my campaign to use a different template. It didn't seem to matter what section I replaced, I ended up replacing content in html_SIDECOLUMN and then the template switch on the campaign worked. Thanks for replying!