Client.GetCampaigns webbased version

I'm developing a recent campaigns overview using Client.GetCampaigns, which I'd like to link to the webbased version of a campaign ( http://xxx.createsend.com/t/ViewEmail/r/xxx/ ). The API however returns a CampaignID that is different from the one used in the CM tool. Is there any way to fetch the right ID and make this work?

Phil Phil, 7 years ago

Hi Tijs,

Great question. Unfortunately, at this stage there is no way to get ViewEmail to operate using the API CampaignIDs. I have however logged a feature request, so when we do implement this feature you'll be the first to know.

You can however find a link within the "Client Settings" page saying "Create newsletter archive". That page will provide you with a bit of javascript which generates a series of links to named past campaigns, in the format you're looking for. Hopefully that'll be enough to keep you going in the meantime.

Tijs, 7 years ago

Thanks for your reply! The JS solution was available in Mailbuild as well, but I'd rather prefer a server-side approach.

Tijs, 7 years ago

Any news on this already? Shouldn't be too hard, right?

Alex D, 7 years ago

Ya this one is a show stopper for me to.. If a client creates an email via API, you should be able to preview it to!!


Alex Duffield - Owner
InControl Solutions
http://www.incontrolsolutions.com
Tijs, 7 years ago

*bump*

Jase, 7 years ago
Tijs :

I'm developing a recent campaigns overview using Client.GetCampaigns, which I'd like to link to the webbased version of a campaign ( http://xxx.createsend.com/t/ViewEmail/r/xxx/ ). The API however returns a CampaignID that is different from the one used in the CM tool. Is there any way to fetch the right ID and make this work?

I need this really badly (have posted regarding it before).

If we could have the option for the web based archive to show the Subject instead of the Campaign Name also that would be a godsend.

Tijs, 6 years ago

*bump again*

Any updates?

Mathew Mathew, 6 years ago

I'm afraid this is not something we have scheduled in right now, but we are recording your requests and our developers are aware of them.


Get in touch with us on Twitter: http://twitter.com/campaignmonitor
We're also on Facebook: http://facebook.com/campaignmonitor
dazhall, 5 years ago

I wanted control over the formatting of the links so I've hacked up a little solution. I got the link to the JavaScript file from "Client Settings" by clicking the "Create newsletter archive" link on the right hand side, then used 'file_get_contents' and 'preg_match_all' to get the data I wanted into an array. I know it's not the best way to do it but until the API includes the functionality to get the link it'll do for me.

<?php
$data = file_get_contents('http://yourusername.createsend.com/path/to/javascript/file/');
$lines = preg_match_all('/\<a\ href\=\"(.*)\"\ target\=\"\_blank\"\>(.*)\<\/a\>\,\ (.*)\</',$data,$matches);
$newsletters = array();

for ($i=0; $i<sizeof($matches[0]); $i++) {
    $newsletters[] = array('URL'=>$matches[1][$i],'Name'=>$matches[2][$i],'DateSent'=>$matches[4][$i]);
}

echo '<dl>';
foreach ($newsletters as $newsletter) {
    echo '<dt>'.$newsletter['Name'].'</dt>';
    echo '<dd>'.$newsletter['URL'].'</dd>';
    echo '<dd>'.$newsletter['DateSent'].'</dd>';
}
echo '</dl>';
?>
jamesd jamesd, 5 years ago

Just an update on this for anyone subscribed to this topic. I'm happy to say that we've scheduled this improvement as part of the new version of our API.

If you have any other suggestions for features you would like to see in our new API, please let us know.

abberdab, 5 years ago

Thanks, dazhall! Your script was exactly what I needed. I added a little extra mojo to match my campaign name prefixes. This enabled me to only show campaigns sent to a given list beneath the subscription form for that list. Perfect! (So long as the campaigns are named correctly…). In my client's case, they have a subscription list that is semi-private and one that is public. We needed to be able to separate the campaigns sent to one or the other accordingly.

modernactivity, 5 years ago

Is this now added into the api? Is there a way to add the campaign ID into an email itself?

jamesd jamesd, 5 years ago

Yes, this is now part of the API. The web version URL for a campaign is available when you get a campaign summary or when you get a list of campaigns for a client.

Join 150,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098