Skip to content

Instantly share code, notes, and snippets.

View manosriglis's full-sized avatar

Manos Riglis manosriglis

  • Dayrize
  • Edinburgh
View GitHub Profile
@manosriglis
manosriglis / cm_copy_list.php
Last active February 18, 2016 09:11
Duplicate campaign monitor lists with custom field definitions
<?php
require_once 'vendor/campaignmonitor/createsend-php/csrest_lists.php';
$sourceList = new CS_REST_Lists('LIST_ID', array('api_key' => 'API_KEY'));
$targetList = new CS_REST_Lists('LIST_ID', array('api_key' => 'API_KEY'));
$result = $sourceList->get_custom_fields();
foreach($result->response as $field){