Mailchimp_Campaigns

The Mailchimp Subscription Form Mailchimp Campaigns class.

Defined (1)

The class is defined in the following location(s).

/classes/mailchimp/Mailchimp/Campaigns.php  
  1. class Mailchimp_Campaigns { 
  2. public function __construct(NM_Mailchimp $master) { 
  3. $this->master = $master; 
  4.  
  5. /** 
  6. * Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content 
  7. * @param string $cid 
  8. * @param associative_array $options 
  9. * - view string optional one of "archive" (default), "preview" (like our popup-preview) or "raw" 
  10. * - email associative_array optional if provided, view is "archive" or "preview", the campaign's list still exists, and the requested record is subscribed to the list. the returned content will be populated with member data populated. a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. If multiple keys are provided, the first one from the following list that we find will be used, the rest will be ignored. 
  11. * - email string an email address 
  12. * - euid string the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc. 
  13. * - leid string the list email id (previously called web_id) for a list-member-info type call. this doesn't change when the email address changes 
  14. * @return associative_array containing all content for the campaign 
  15. * - html string The HTML content used for the campaign with merge tags intact 
  16. * - text string The Text content used for the campaign with merge tags intact 
  17. */ 
  18. public function content($cid, $options=array()) { 
  19. $_params = array("cid" => $cid, "options" => $options); 
  20. return $this->master->call('campaigns/content', $_params); 
  21.  
  22. /** 
  23. * Create a new draft campaign to send. You <strong>can not</strong> have more than 32, 000 campaigns in your account. 
  24. * @param string $type 
  25. * @param associative_array $options 
  26. * - list_id string the list to send this campaign to- get lists using lists/list() 
  27. * - subject string the subject line for your campaign message 
  28. * - from_email string the From: email address for your campaign message 
  29. * - from_name string the From: name for your campaign message (not an email address) 
  30. * - to_name string the To: name recipients will see (not email address) 
  31. * - template_id int optional - use this user-created template to generate the HTML content of the campaign (takes precendence over other template options) 
  32. * - gallery_template_id int optional - use a template from the public gallery to generate the HTML content of the campaign (takes precendence over base template options) 
  33. * - base_template_id int optional - use this a base/start-from-scratch template to generate the HTML content of the campaign 
  34. * - folder_id int optional - automatically file the new campaign in the folder_id passed. Get using folders/list() - note that Campaigns and Autoresponders have separate folder setups 
  35. * - tracking associative_array optional - set which recipient actions will be tracked. Click tracking can not be disabled for Free accounts. 
  36. * - opens bool whether to track opens, defaults to true 
  37. * - html_clicks bool whether to track clicks in HTML content, defaults to true 
  38. * - text_clicks bool whether to track clicks in Text content, defaults to false 
  39. * - title string optional - an internal name to use for this campaign. By default, the campaign subject will be used. 
  40. * - authenticate boolean optional - set to true to enable SenderID, DomainKeys, and DKIM authentication, defaults to false. 
  41. * - analytics associative_array optional - one or more of these keys set to the tag to use - that can be any custom text (up to 50 bytes) 
  42. * - google string for Google Analytics tracking 
  43. * - clicktale string for ClickTale tracking 
  44. * - gooal string for Goal tracking (the extra 'o' in the param name is not a typo) 
  45. * - auto_footer boolean optional Whether or not we should auto-generate the footer for your content. Mostly useful for content from URLs or Imports 
  46. * - inline_css boolean optional Whether or not css should be automatically inlined when this campaign is sent, defaults to false. 
  47. * - generate_text boolean optional Whether of not to auto-generate your Text content from the HTML content. Note that this will be ignored if the Text part of the content passed is not empty, defaults to false. 
  48. * - auto_tweet boolean optional If set, this campaign will be auto-tweeted when it is sent - defaults to false. Note that if a Twitter account isn't linked, this will be silently ignored. 
  49. * - auto_fb_post array optional If set, this campaign will be auto-posted to the page_ids contained in the array. If a Facebook account isn't linked or the account does not have permission to post to the page_ids requested, those failures will be silently ignored. 
  50. * - fb_comments boolean optional If true, the Facebook comments (and thus the <a href="http://kb.mailchimp.com/article/i-dont-want-an-archiave-of-my-campaign-can-i-turn-it-off/" target="_blank">archive bar</a> will be displayed. If false, Facebook comments will not be enabled (does not imply no archive bar, see previous link). Defaults to "true". 
  51. * - timewarp boolean optional If set, this campaign must be scheduled 24 hours in advance of sending - default to false. Only valid for "regular" campaigns and "absplit" campaigns that split on schedule_time. 
  52. * - ecomm360 boolean optional If set, our <a href="http://www.mailchimp.com/blog/ecommerce-tracking-plugin/" target="_blank">Ecommerce360 tracking</a> will be enabled for links in the campaign 
  53. * - crm_tracking associative_array optional If set, a struct to enable CRM tracking for: 
  54. * - salesforce associative_array optional Enable SalesForce push back 
  55. * - campaign bool optional - if true, create a Campaign object and update it with aggregate stats 
  56. * - notes bool optional - if true, attempt to update Contact notes based on email address 
  57. * - highrise associative_array optional Enable Highrise push back 
  58. * - campaign bool optional - if true, create a Kase object and update it with aggregate stats 
  59. * - notes bool optional - if true, attempt to update Contact notes based on email address 
  60. * - capsule associative_array optional Enable Capsule push back (only notes are supported) 
  61. * - notes bool optional - if true, attempt to update Contact notes based on email address 
  62. * @param associative_array $content 
  63. * - html string for raw/pasted HTML content 
  64. * - sections associative_array when using a template instead of raw HTML, each key should be the unique mc:edit area name from the template. 
  65. * - text string for the plain-text version 
  66. * - url string to have us pull in content from a URL. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well 
  67. * - archive string to send a Base64 encoded archive file for us to import all media from. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well 
  68. * - archive_type string optional - only necessary for the "archive" option. Supported formats are: zip, tar.gz, tar.bz2, tar, tgz, tbz . If not included, we will default to zip 
  69. * @param associative_array $segment_opts 
  70. * @param associative_array $type_opts 
  71. * - rss associative_array For RSS Campaigns this, struct should contain: 
  72. * - url string the URL to pull RSS content from - it will be verified and must exist 
  73. * - schedule string optional one of "daily", "weekly", "monthly" - defaults to "daily" 
  74. * - schedule_hour string optional an hour between 0 and 24 - default to 4 (4am <em>local time</em>) - applies to all schedule types 
  75. * - schedule_weekday string optional for "weekly" only, a number specifying the day of the week to send: 0 (Sunday) - 6 (Saturday) - defaults to 1 (Monday) 
  76. * - schedule_monthday string optional for "monthly" only, a number specifying the day of the month to send (1 - 28) or "last" for the last day of a given month. Defaults to the 1st day of the month 
  77. * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on 
  78. * - 1 bool optional Monday, defaults to true 
  79. * - 2 bool optional Tuesday, defaults to true 
  80. * - 3 bool optional Wednesday, defaults to true 
  81. * - 4 bool optional Thursday, defaults to true 
  82. * - 5 bool optional Friday, defaults to true 
  83. * - 6 bool optional Saturday, defaults to true 
  84. * - 7 bool optional Sunday, defaults to true 
  85. * - absplit associative_array For A/B Split campaigns, this struct should contain: 
  86. * - split_test string The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaigns/schedule() separately! 
  87. * - pick_winner string How the winner will be picked, one of: "opens" (by the open_rate), "clicks" (by the click rate), "manual" (you pick manually) 
  88. * - wait_units int optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400. 
  89. * - wait_time int optional the number of units to wait before auto-selecting a winner - defaults to 1, so if not set, a winner will be selected after 1 Day. 
  90. * - split_size int optional this is a percentage of what size the Campaign's List plus any segmentation options results in. "schedule" type forces 50%, all others default to 10% 
  91. * - from_name_a string optional sort of, required when split_test is "from_name" 
  92. * - from_name_b string optional sort of, required when split_test is "from_name" 
  93. * - from_email_a string optional sort of, required when split_test is "from_name" 
  94. * - from_email_b string optional sort of, required when split_test is "from_name" 
  95. * - subject_a string optional sort of, required when split_test is "subject" 
  96. * - subject_b string optional sort of, required when split_test is "subject" 
  97. * - auto associative_array For AutoResponder campaigns, this struct should contain: 
  98. * - offset-units string one of "hourly", "day", "week", "month", "year" - required 
  99. * - offset-time string optional, sort of - the number of units must be a number greater than 0 for signup based autoresponders, ignored for "hourly" 
  100. * - offset-dir string either "before" or "after", ignored for "hourly" 
  101. * - event string optional "signup" (default) to base this members added to a list, "date", "annual", or "birthday" to base this on merge field in the list, "campaignOpen" or "campaignClicka" to base this on any activity for a campaign, "campaignClicko" to base this on clicks on a specific URL in a campaign, "mergeChanged" to base this on a specific merge field being changed to a specific value 
  102. * - event-datemerge string optional sort of, this is required if the event is "date", "annual", "birthday", or "mergeChanged" 
  103. * - campaign_id string optional sort of, required for "campaignOpen", "campaignClicka", or "campaignClicko" 
  104. * - campaign_url string optional sort of, required for "campaignClicko" 
  105. * - schedule_hour int The hour of the day - 24 hour format in GMT - the autoresponder should be triggered, ignored for "hourly" 
  106. * - use_import_time boolean whether or not imported subscribers (ie, <em>any</em> non-double optin subscribers) will receive 
  107. * - days associative_array optional used for "daily" schedules only, an array of the <a href="http://en.wikipedia.org/wiki/ISO-8601#Week_dates" target="_blank">ISO-8601 weekday numbers</a> to send on< 
  108. * - 1 bool optional Monday, defaults to true 
  109. * - 2 bool optional Tuesday, defaults to true 
  110. * - 3 bool optional Wednesday, defaults to true 
  111. * - 4 bool optional Thursday, defaults to true 
  112. * - 5 bool optional Friday, defaults to true 
  113. * - 6 bool optional Saturday, defaults to true 
  114. * - 7 bool optional Sunday, defaults to true 
  115. * @return associative_array the new campaign's details - will return same data as single campaign from campaigns/list() 
  116. */ 
  117. public function create($type, $options, $content, $segment_opts=null, $type_opts=null) { 
  118. $_params = array("type" => $type, "options" => $options, "content" => $content, "segment_opts" => $segment_opts, "type_opts" => $type_opts); 
  119. return $this->master->call('campaigns/create', $_params); 
  120.  
  121. /** 
  122. * Delete a campaign. Seriously, "poof, gone!" - be careful! Seriously, no one can undelete these. 
  123. * @param string $cid 
  124. * @return associative_array with a single entry: 
  125. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  126. */ 
  127. public function delete($cid) { 
  128. $_params = array("cid" => $cid); 
  129. return $this->master->call('campaigns/delete', $_params); 
  130.  
  131. /** 
  132. * Get the list of campaigns and their details matching the specified filters 
  133. * @param associative_array $filters 
  134. * - campaign_id string optional - return the campaign using a know campaign_id. Accepts multiples separated by commas when not using exact matching. 
  135. * - parent_id string optional - return the child campaigns using a known parent campaign_id. Accepts multiples separated by commas when not using exact matching. 
  136. * - list_id string optional - the list to send this campaign to - get lists using lists/list(). Accepts multiples separated by commas when not using exact matching. 
  137. * - folder_id int optional - only show campaigns from this folder id - get folders using folders/list(). Accepts multiples separated by commas when not using exact matching. 
  138. * - template_id int optional - only show campaigns using this template id - get templates using templates/list(). Accepts multiples separated by commas when not using exact matching. 
  139. * - status string optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending". Accepts multiples separated by commas when not using exact matching. 
  140. * - type string optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "auto". Accepts multiples separated by commas when not using exact matching. 
  141. * - from_name string optional - only show campaigns that have this "From Name" 
  142. * - from_email string optional - only show campaigns that have this "Reply-to Email" 
  143. * - title string optional - only show campaigns that have this title 
  144. * - subject string optional - only show campaigns that have this subject 
  145. * - sendtime_start string optional - only show campaigns that have been sent since this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails 
  146. * - sendtime_end string optional - only show campaigns that have been sent before this date/time (in GMT) - - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00" - if this is invalid the whole call fails 
  147. * - uses_segment boolean - whether to return just campaigns with or without segments 
  148. * - exact boolean optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true. Using this disables the use of any filters that accept multiples. 
  149. * @param int $start 
  150. * @param int $limit 
  151. * @param string $sort_field 
  152. * @param string $sort_dir 
  153. * @return associative_array containing a count of all matching campaigns, the specific ones for the current page, and any errors from the filters provided 
  154. * - total int the total number of campaigns matching the filters passed in 
  155. * - data array structs for each campaign being returned 
  156. * - id string Campaign Id (used for all other campaign functions) 
  157. * - web_id int The Campaign id used in our web app, allows you to create a link directly to it 
  158. * - list_id string The List used for this campaign 
  159. * - folder_id int The Folder this campaign is in 
  160. * - template_id int The Template this campaign uses 
  161. * - content_type string How the campaign's content is put together - one of 'template', 'html', 'url' 
  162. * - title string Title of the campaign 
  163. * - type string The type of campaign this is (regular, plaintext, absplit, rss, inspection, auto) 
  164. * - create_time string Creation time for the campaign 
  165. * - send_time string Send time for the campaign - also the scheduled time for scheduled campaigns. 
  166. * - emails_sent int Number of emails email was sent to 
  167. * - status string Status of the given campaign (save, paused, schedule, sending, sent) 
  168. * - from_name string From name of the given campaign 
  169. * - from_email string Reply-to email of the given campaign 
  170. * - subject string Subject of the given campaign 
  171. * - to_name string Custom "To:" email string using merge variables 
  172. * - archive_url string Archive link for the given campaign 
  173. * - inline_css boolean Whether or not the campaign content's css was auto-inlined 
  174. * - analytics string Either "google" if enabled or "N" if disabled 
  175. * - analytics_tag string The name/tag the campaign's links were tagged with if analytics were enabled. 
  176. * - authenticate boolean Whether or not the campaign was authenticated 
  177. * - ecomm360 boolean Whether or not ecomm360 tracking was appended to links 
  178. * - auto_tweet boolean Whether or not the campaign was auto tweeted after sending 
  179. * - auto_fb_post string A comma delimited list of Facebook Profile/Page Ids the campaign was posted to after sending. If not used, blank. 
  180. * - auto_footer boolean Whether or not the auto_footer was manually turned on 
  181. * - timewarp boolean Whether or not the campaign used Timewarp 
  182. * - timewarp_schedule string The time, in GMT, that the Timewarp campaign is being sent. For A/B Split campaigns, this is blank and is instead in their schedule_a and schedule_b in the type_opts array 
  183. * - parent_id string the unique id of the parent campaign (currently only valid for rss children). Will be blank for non-rss child campaigns or parent campaign has been deleted. 
  184. * - is_child boolean true if this is an RSS child campaign. Will return true even if the parent campaign has been deleted. 
  185. * - tests_sent string tests sent 
  186. * - tests_remain int test sends remaining 
  187. * - tracking associative_array the various tracking options used 
  188. * - html_clicks boolean whether or not tracking for html clicks was enabled. 
  189. * - text_clicks boolean whether or not tracking for text clicks was enabled. 
  190. * - opens boolean whether or not opens tracking was enabled. 
  191. * - segment_text string a string marked-up with HTML explaining the segment used for the campaign in plain English 
  192. * - segment_opts array the segment used for the campaign - can be passed to campaigns/segment-test or campaigns/create() 
  193. * - saved_segment associative_array if a saved segment was used (match+conditions returned above): 
  194. * - id int the saved segment id 
  195. * - type string the saved segment type 
  196. * - name string the saved segment name 
  197. * - type_opts associative_array the type-specific options for the campaign - can be passed to campaigns/create() 
  198. * - comments_total int total number of comments left on this campaign 
  199. * - comments_unread int total number of unread comments for this campaign based on the login the apikey belongs to 
  200. * - summary associative_array if available, the basic aggregate stats returned by reports/summary 
  201. * - social_card associative_array If a social card has been attached to this campaign: 
  202. * - title string The title of the campaign used with the card 
  203. * - description string The description used with the card 
  204. * - image_url string The URL of the image used with the card 
  205. * - enabled string Whether or not the social card is enabled for this campaign. 
  206. * - errors array structs of any errors found while loading lists - usually just from providing invalid list ids 
  207. * - filter string the filter that caused the failure 
  208. * - value string the filter value that caused the failure 
  209. * - code int the error code 
  210. * - error string the error message 
  211. */ 
  212. public function getList($filters=array(), $start=0, $limit=25, $sort_field='create_time', $sort_dir='DESC') { 
  213. $_params = array("filters" => $filters, "start" => $start, "limit" => $limit, "sort_field" => $sort_field, "sort_dir" => $sort_dir); 
  214. return $this->master->call('campaigns/list', $_params); 
  215.  
  216. /** 
  217. * Pause an AutoResponder or RSS campaign from sending 
  218. * @param string $cid 
  219. * @return associative_array with a single entry: 
  220. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  221. */ 
  222. public function pause($cid) { 
  223. $_params = array("cid" => $cid); 
  224. return $this->master->call('campaigns/pause', $_params); 
  225.  
  226. /** 
  227. * Returns information on whether a campaign is ready to send and possible issues we may have detected with it - very similar to the confirmation step in the app. 
  228. * @param string $cid 
  229. * @return associative_array containing: 
  230. * - is_ready bool whether or not you're going to be able to send this campaign 
  231. * - items array an array of structs explaining basically what the app's confirmation step would 
  232. * - type string the item type - generally success, warning, or error 
  233. * - heading string the item's heading in the app 
  234. * - details string the item's details from the app, sans any html tags/links 
  235. */ 
  236. public function ready($cid) { 
  237. $_params = array("cid" => $cid); 
  238. return $this->master->call('campaigns/ready', $_params); 
  239.  
  240. /** 
  241. * Replicate a campaign. 
  242. * @param string $cid 
  243. * @return associative_array the matching campaign's details - will return same data as single campaign from campaigns/list() 
  244. */ 
  245. public function replicate($cid) { 
  246. $_params = array("cid" => $cid); 
  247. return $this->master->call('campaigns/replicate', $_params); 
  248.  
  249. /** 
  250. * Resume sending an AutoResponder or RSS campaign 
  251. * @param string $cid 
  252. * @return associative_array with a single entry: 
  253. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  254. */ 
  255. public function resume($cid) { 
  256. $_params = array("cid" => $cid); 
  257. return $this->master->call('campaigns/resume', $_params); 
  258.  
  259. /** 
  260. * Schedule a campaign to be sent in the future 
  261. * @param string $cid 
  262. * @param string $schedule_time 
  263. * @param string $schedule_time_b 
  264. * @return associative_array with a single entry: 
  265. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  266. */ 
  267. public function schedule($cid, $schedule_time, $schedule_time_b=null) { 
  268. $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "schedule_time_b" => $schedule_time_b); 
  269. return $this->master->call('campaigns/schedule', $_params); 
  270.  
  271. /** 
  272. * Schedule a campaign to be sent in batches sometime in the future. Only valid for "regular" campaigns 
  273. * @param string $cid 
  274. * @param string $schedule_time 
  275. * @param int $num_batches 
  276. * @param int $stagger_mins 
  277. * @return associative_array with a single entry: 
  278. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  279. */ 
  280. public function scheduleBatch($cid, $schedule_time, $num_batches=2, $stagger_mins=5) { 
  281. $_params = array("cid" => $cid, "schedule_time" => $schedule_time, "num_batches" => $num_batches, "stagger_mins" => $stagger_mins); 
  282. return $this->master->call('campaigns/schedule-batch', $_params); 
  283.  
  284. /** 
  285. * Allows one to test their segmentation rules before creating a campaign using them. 
  286. * @param string $list_id 
  287. * @param associative_array $options 
  288. * - saved_segment_id string a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required. 
  289. * - match string controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND) 
  290. * - conditions array of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions: 
  291. * @return associative_array with a single entry: 
  292. * - total int The total number of subscribers matching your segmentation options 
  293. */ 
  294. public function segmentTest($list_id, $options) { 
  295. $_params = array("list_id" => $list_id, "options" => $options); 
  296. return $this->master->call('campaigns/segment-test', $_params); 
  297.  
  298. /** 
  299. * Send a given campaign immediately. For RSS campaigns, this will "start" them. 
  300. * @param string $cid 
  301. * @return associative_array with a single entry: 
  302. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  303. */ 
  304. public function send($cid) { 
  305. $_params = array("cid" => $cid); 
  306. return $this->master->call('campaigns/send', $_params); 
  307.  
  308. /** 
  309. * Send a test of this campaign to the provided email addresses 
  310. * @param string $cid 
  311. * @param array $test_emails 
  312. * @param string $send_type 
  313. * @return associative_array with a single entry: 
  314. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  315. */ 
  316. public function sendTest($cid, $test_emails=array(), $send_type='html') { 
  317. $_params = array("cid" => $cid, "test_emails" => $test_emails, "send_type" => $send_type); 
  318. return $this->master->call('campaigns/send-test', $_params); 
  319.  
  320. /** 
  321. * Get the HTML template content sections for a campaign. Note that this <strong>will</strong> return very jagged, non-standard results based on the template 
  322. a campaign is using. You only want to use this if you want to allow editing template sections in your application. 
  323. * @param string $cid 
  324. * @return associative_array content containing all content section for the campaign - section name are dependent upon the template used and thus can't be documented 
  325. */ 
  326. public function templateContent($cid) { 
  327. $_params = array("cid" => $cid); 
  328. return $this->master->call('campaigns/template-content', $_params); 
  329.  
  330. /** 
  331. * Unschedule a campaign that is scheduled to be sent in the future 
  332. * @param string $cid 
  333. * @return associative_array with a single entry: 
  334. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  335. */ 
  336. public function unschedule($cid) { 
  337. $_params = array("cid" => $cid); 
  338. return $this->master->call('campaigns/unschedule', $_params); 
  339.  
  340. /** 
  341. * Update just about any setting besides type for a campaign that has <em>not</em> been sent. See campaigns/create() for details. 
  342. Caveats:<br/><ul class='bullets'> 
  343. <li>If you set a new list_id, all segmentation options will be deleted and must be re-added.</li> 
  344. <li>If you set template_id, you need to follow that up by setting it's 'content'</li> 
  345. <li>If you set segment_opts, you should have tested your options against campaigns/segment-test().</li> 
  346. <li>To clear/unset segment_opts, pass an empty string or array as the value. Various wrappers may require one or the other.</li> 
  347. </ul> 
  348. * @param string $cid 
  349. * @param string $name 
  350. * @param array $value 
  351. * @return associative_array updated campaign details and any errors 
  352. * - data associative_array the update campaign details - will return same data as single campaign from campaigns/list() 
  353. * - errors array for "options" only - structs containing: 
  354. * - code int the error code 
  355. * - message string the full error message 
  356. * - name string the parameter name that failed 
  357. */ 
  358. public function update($cid, $name, $value) { 
  359. $_params = array("cid" => $cid, "name" => $name, "value" => $value); 
  360. return $this->master->call('campaigns/update', $_params); 
  361.