populate content that has mc:allowtext

199 views
Skip to first unread message

Wondergraphs

unread,
Dec 23, 2010, 10:46:55 AM12/23/10
to MailChimp API Discuss
Dear,


We are forced to use the API to set up a transactional campaign that
is based on our general template. Some of the content sections in our
template are images coded as follows:

<img mc:edit="image1" src="..." mc:allowdesigner mc:allowtext />

Is there any way to replace the image with text via the API? I tried
to set content[html_image1]="my text" in the campaignCreate function,
but of no avail.

I understand why you are forcing people to create transactional
campaigns via the API, but it would be great if we could at least use
the campaign builder on an existing transactional campaign so we can
tweak the content, send tests, etc.


Many thanks,


Wondergraphs

jesse

unread,
Dec 23, 2010, 11:35:31 AM12/23/10
to MailChimp API Discuss
You can already do that. Edit the template in the web app and then use
it in your campaignCreate() call. Or edit a campaign and save it as a
template. Or upload your own template.

Apart from doing that, what I said here would apply:

http://groups.google.com/group/mailchimp-api-discuss/browse_thread/thread/f05d80576b8c0782#


jesse

Wondergraphs

unread,
Dec 23, 2010, 4:16:03 PM12/23/10
to MailChimp API Discuss
Hi Jesse,

The campaignTemplateContent from your link gave me an idea.

I now do:
1) array content = campaignTemplateContent(existing non-transactional
campaign 1 based on template A)
2) for each content section name: add prefix html_
3) campaignUpdate(transactional campaign 2 based on template A,
"content", content)

The result is that sections that contain anchors <a> look ok, but give
weird results when sending out the e-mail.

The content is <a href="*|SITE|*">*|SITE|*</a>

non-transactional campaign 1 encodes
<a href="https://greatcorp.wondergraphs.com" style="color:#1A6A99;text-
decoration:underline;font-weight:bold" target="_blank">https://
greatcorp.<wbr>wondergraphs.com</a>

transactional campaign 2 encodes
<a>https://wondergraphs.<wbr>wondergraphs.com</a>" style="color:
#1A6A99;text-decoration: underline;font-weight: bold;"&gt;<a
href="https://wondergraphs.wondergraphs.com" target="_blank">https://
wondergraphs.<wbr>wondergraphs.com</a>

Any ideas?

Thanks,

Wondergraphs


On Dec 23, 5:35 pm, jesse <je...@mailchimp.com> wrote:
> You can already do that. Edit the template in the web app and then use
> it in your campaignCreate() call. Or edit a campaign and save it as a
> template. Or upload your own template.
>
> Apart from doing that, what I said here would apply:
>
> http://groups.google.com/group/mailchimp-api-discuss/browse_thread/th...

Wondergraphs

unread,
Dec 23, 2010, 5:04:27 PM12/23/10
to MailChimp API Discuss
Hi Jesse,


Tried the other suggestion you had:
1) saved the design of the working campaign 1 based on template A to a
new template B
2) campaignCreate(apiKey, "trans", ...) with template B (so there is
no need to set proper content sessions)
still same problem
3) campaignCreate(apiKey, "regular", ...) with template B
still same problem

It seems that I cannot replicate my existing campaign by exporting it
to a template and using the campaignCreate API call?


Thanks,


Wondergraphs

jesse

unread,
Dec 27, 2010, 12:13:14 PM12/27/10
to MailChimp API Discuss
The last content problem you explained that I gave some suggestions
for had nothing to do with whether or not you are using a template.
Take another look at what I said to get that straightened out

Once you have, then yes, you can essentially replicate a campaign by
saving it as a template and reimporting it via campaignCreate.
However, that doesn't seem to make much sense either. My suggestion
for looking at using a template was not to do what you're explaining,
but rather to setup a simple template that you would still populate
content in, but make it specific to your purpose such that populating
the content is straightforward and the code involved could be
simplified.


jesse
Reply all
Reply to author
Forward
0 new messages