Create campaign using custom template id

1,568 views
Skip to first unread message

Madhu Shirke

unread,
Oct 4, 2012, 12:41:11 AM10/4/12
to mailchimp-...@googlegroups.com
Hello,

I have problem using mailchimp api. I am trying to use campaignCreate()
method for creating campaign. I have pass the custom template id for this
and try to add the data into template sections like std_preheader_content
,std_content00.

For simple template it will accept the std_content00, but for the custom
template it will not add the data into std_content00 section, it will take
the default data into that section. Can you help me to solve this issue.

Thanks,
Madhu

jesse

unread,
Oct 4, 2012, 6:23:34 AM10/4/12
to mailchimp-...@googlegroups.com
Sure - just make sure you read the docs fully. Specifically they say:
"If you chose a template instead of pasting in your HTML content, then use "html_" followed by the template sections as keys - for example, use a key of "html_MAIN" to fill in the "MAIN" section of a template."

Here's also one of a number of posts here talking about the same thing:
https://groups.google.com/forum/#!searchin/mailchimp-api-discuss/template$20section$20names/mailchimp-api-discuss/L8UDQuWjVE4/sF_Tk11vWoAJ


jesse

Madhu Shirke

unread,
Oct 4, 2012, 8:32:21 AM10/4/12
to mailchimp-...@googlegroups.com
Thanks for the reply. I also read the document.

Yes i am using template id for createCampaign() method. In mailchimp account i have created the same template like postcard template having image and text. and i am using that template for campaign creation.

I am try to add the data into campaign by passing the section along with the value.

When i find the sections of template using templateInfo() method it return the default sections are std_preheader_content, std_preheader_links, postcard_heading00, std_content00, std_social, std_footer.

But when i try to add the into "html_std_content00" section it will not be added. I also try the "html_MAIN" section and add data but still it not added the data.

jesse

unread,
Oct 4, 2012, 8:41:23 AM10/4/12
to mailchimp-...@googlegroups.com
If you're sending the proper section names then it's likely you're not urlencoding values and destroying the GET/POST request you are making.


jesse

Madhu Shirke

unread,
Oct 4, 2012, 9:11:15 AM10/4/12
to mailchimp-...@googlegroups.com
But its working for the simple template. Only problem with the template containting images and text.

Madhu Shirke

unread,
Oct 4, 2012, 9:27:06 AM10/4/12
to mailchimp-...@googlegroups.com
And one more question i refer other post of users everywhere said that the template section are main, footer, etc. I also use that still not works.My template does not returning main section. Waiting for the reply. I am using Mailchimp API with Django does it affects.

jesse

unread,
Oct 4, 2012, 9:41:28 AM10/4/12
to mailchimp-...@googlegroups.com
I've pointed your at pretty much all the information I can, and that's definitely working. Sections names can be whatever, so as I mentioned, you'll just need to pass them correctly based on the documentation and the names you are actually using. If it is an issue with the particular wrapper/system you are using, you'd need to debug that on your end.


jesse

Madhu Shirke

unread,
Oct 12, 2012, 3:48:12 AM10/12/12
to mailchimp-...@googlegroups.com
Hello Jesse,

Thanks for the response, I tried a lot, the data will be added into the sections like "std_preheader_content", "std_preheader_links,"std_social",and "std_footer". Anything will be added into the above section image or text thats added properly.

Problem with the sections like "postcard_heading00", "std_content00" and "postcard_image" section.
Can you please tell me why this happens?
I am using the api key ended with us-5.

Madhu Shirke

unread,
Oct 12, 2012, 5:08:13 AM10/12/12
to mailchimp-...@googlegroups.com
Hello

When i call campaignTemplateContent() method with created campaigns using campign id then it will display the proper content added into the section "std_content00", but that content will not be display on mailchimp account campaign.

samir das

unread,
Oct 12, 2012, 6:38:04 AM10/12/12
to mailchimp-...@googlegroups.com
Hi everyone,

I have also same problem. I am trying to implement mailchip api in my python django application. But I can post my content into content section. I will mentioned my problem below,

#views.py

from mailsnake import MailSnake
from mailsnake.exceptions import *

def mailchimp(request):

    mailsnake = MailSnake('API-KEY')

    template_option = {'list_id':list_id,
                        'subject':'Test subject',
                        'from_email':'EXA...@EXAMPLE.COM',
                        'from_name':'Michel',
                        'to_name':'',
                        'inline_css':True,
                        'template_id':12345,
                        'generate_text': True,
                        'title':'Test title',
                        'authenticate': True,
                        'auto_footer': True
                        }

template_content = {'html_std_preheader_content': "HEADER CONTENT ",'html_std_preheader_links':"PREHEADER LINK",'html_postcard_heading00':"NEWS LETTER",'html_postcard_image': "IMAGE",'html_std_footer': "FOOTER TEXT",'html_std_content00': "NEWS LETTER CONTENT"}

campaign_create = mailsnake.campaignCreate(type='regular',options = template_option,content=template_content)

I have written above code in my python django application. But can not replace the above content into created campaign.

The data will be added into the sections like "std_preheader_content", "std_preheader_links,"std_social",and "std_footer". Anything will be added into the above section image or text thats added properly. Problem with the sections like "postcard_heading00", "std_content00" and "postcard_image" section. Is there any problem with the repeatable section?

So please help me to solve this problem. Is I am wrong in coding or any settings?

Thanks in advance,
Samdas

Jeff Bonnes

unread,
Feb 6, 2013, 1:32:02 AM2/6/13
to mailchimp-...@googlegroups.com
I was having the same problem until I renamed the sections in my template.  For example, it wasn't working when it was called 'body_content' (mc:edit="body_content"in the template) but when I changed the code in the template to mc:edit="main" and set my parameter to html_main : content, it all started working.

jesse

unread,
Feb 6, 2013, 6:03:02 AM2/6/13
to mailchimp-...@googlegroups.com
Renaming a section like that would not fix anything if you were appropriately passing it as html_body_content initially like the docs said.

This thread is being locked.


jesse
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages