Mailchimp_Folders

The Mailchimp Subscription Form Mailchimp Folders class.

Defined (1)

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

/classes/mailchimp/Mailchimp/Folders.php  
  1. class Mailchimp_Folders { 
  2. public function __construct(NM_Mailchimp $master) { 
  3. $this->master = $master; 
  4.  
  5. /** 
  6. * Add a new folder to file campaigns, autoresponders, or templates in 
  7. * @param string $name 
  8. * @param string $type 
  9. * @return associative_array with a single value: 
  10. * - folder_id int the folder_id of the newly created folder. 
  11. */ 
  12. public function add($name, $type) { 
  13. $_params = array("name" => $name, "type" => $type); 
  14. return $this->master->call('folders/add', $_params); 
  15.  
  16. /** 
  17. * Delete a campaign, autoresponder, or template folder. Note that this will simply make whatever was in the folder appear unfiled, no other data is removed 
  18. * @param int $fid 
  19. * @param string $type 
  20. * @return associative_array with a single entry: 
  21. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  22. */ 
  23. public function del($fid, $type) { 
  24. $_params = array("fid" => $fid, "type" => $type); 
  25. return $this->master->call('folders/del', $_params); 
  26.  
  27. /** 
  28. * List all the folders of a certain type 
  29. * @param string $type 
  30. * @return array structs for each folder, including: 
  31. * - folder_id int Folder Id for the given folder, this can be used in the campaigns/list() function to filter on. 
  32. * - name string Name of the given folder 
  33. * - date_created string The date/time the folder was created 
  34. * - type string The type of the folders being returned, just to make sure you know. 
  35. * - cnt int number of items in the folder. 
  36. */ 
  37. public function getList($type) { 
  38. $_params = array("type" => $type); 
  39. return $this->master->call('folders/list', $_params); 
  40.  
  41. /** 
  42. * Update the name of a folder for campaigns, autoresponders, or templates 
  43. * @param int $fid 
  44. * @param string $name 
  45. * @param string $type 
  46. * @return associative_array with a single entry: 
  47. * - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise. 
  48. */ 
  49. public function update($fid, $name, $type) { 
  50. $_params = array("fid" => $fid, "name" => $name, "type" => $type); 
  51. return $this->master->call('folders/update', $_params); 
  52.