Content Update Via Url

39 views
Skip to first unread message

Marco

unread,
Oct 5, 2009, 5:22:24 PM10/5/09
to MailChimp API Discuss
Hi,

I'm trying to update a campaign with new content via url:

$opts['inline_css'] = $this->data['Campaign']['inline_css'];
$opts['content'] = array('url'=>$this->data['Campaign']['url']);

foreach ($opts as $key=>$value) {
$this->api->campaignUpdate($mid, $key, $value);
if ($this->api->errorCode){
........
}
}

I get no error but the content doesn't change, I tried online and all
work.

DavidMcL, Perceptive Logic

unread,
Oct 6, 2009, 9:23:56 AM10/6/09
to MailChimp API Discuss
Hi Marco & Jesse

I just ran across this myself -- what's happening (at least for me) is
that it is updating the url to the campaign, but not putting in the
content for that url.

If you go out to the campaign you can see the right url in the 'import
from url' tab, but unless you go out to the admin panel & do something
like a pop-up preview the content never gets loaded.

Hope that helps.

David

jesse

unread,
Oct 6, 2009, 11:02:19 AM10/6/09
to MailChimp API Discuss
How are you guys using to check for the content? Via the
campaignContent() call, or something else? Basically, we try not to
bother with pulling the content in until it's needed - via the web
interface, it's obviously needed immediately for preview. Via the API,
it typically isn't needed until the campaign is sent. So, if you let
me know how you are checking it, I'll see what I can do to make it
show up, but generally I would not be worried about that unless it's
actually causing some sort of problem that I'm not considering.


jesse


On Oct 6, 9:23 am, "DavidMcL, Perceptive Logic"

DavidMcL, Perceptive Logic

unread,
Oct 6, 2009, 11:35:05 AM10/6/09
to MailChimp API Discuss
OK -- I suspect that the 'issue' only appears working in a 'mixed'
mode -- api & admin panel -- and the appearance is of a chance not
taking place; scenario follows:

1) An existing campaign has content that you look at in the paste/
import html.
2) You run an api call to update the content from a url
3) You go back to the admin panel and look at the campaign; the 'new'
url is in the 'import from url' tab, but the 'OLD' content is still in
the paste/import tab. This is true even after you do a 'save as
draft' unless you hit some trigger; e.g., preview, add footer, etc. In
that case it then populates the paste/import tab content with the
content from the url in the 'import from url' tab.

The result is that one always wonders whether the change 'really'
worked or not -- somewhat disconcerting.

And one could mistakenly think that then making changes in the 'paste/
import' tab would really be changing the content, but it doesn't
unless one clears out the url from the 'import from url' tab.

Thanks,

David
> > > work.- Hide quoted text -
>
> - Show quoted text -

Marco

unread,
Oct 6, 2009, 11:43:25 AM10/6/09
to MailChimp API Discuss
Hi Jesse,

the main problem is I cant get the preview for my customer (the same
you do via the web interface) with the merge tags like *|
UPDATE_PROFILE|* replaced.
Locally I can grab the html from the url and send it to Mailchimp. The
difference is I will consider the content, from the url I imported, in
that moment not when the campaign will be sent and I think is better.
For some reason when I send the campaign the url could be unavailable.

Marco

jesse

unread,
Oct 6, 2009, 3:38:35 PM10/6/09
to MailChimp API Discuss
Ok - even though I think this is a real edge case that won't be hit/
noticed during normal usage, I made it refresh the content after
running campaignUpdate anyway.


jesse

On Oct 6, 11:35 am, "DavidMcL, Perceptive Logic"

jesse

unread,
Oct 6, 2009, 3:49:27 PM10/6/09
to MailChimp API Discuss
Marco -
That is correct that you can't grab a copy of the content filled in
with preview data - it's another option I'm looking at for a future
version of the campaignContent() function.

As far as us pulling in the content from the URL at the time of send -
that's just how that works. We do cache the content, though, so if the
URL is not available when the campaign sends, we'll use the cached
copy.


jesse

Marco

unread,
Oct 6, 2009, 4:19:15 PM10/6/09
to MailChimp API Discuss
jesse,

you are right, I use the archive_url for the preview with content
filled and the url doesn't display the new html content.

The cache makes sense.

Thanks,

Marco
Reply all
Reply to author
Forward
0 new messages