Overview
  • Namespace
  • Class

Namespaces

  • MailChimp
    • AuthorizedApps
    • Automations
    • Batches
    • CampaignFolders
    • Campaigns
    • Conversations
    • Ecommerce
    • FileManager
    • Lists
    • Reports
    • TemplateFolders
    • Templates

Classes

  • MailChimp\AuthorizedApps\AuthorizedApps
  • MailChimp\Automations\Automations
  • MailChimp\Batches\Batches
  • MailChimp\CampaignFolders\CampaignFolders
  • MailChimp\Campaigns\Campaigns
  • MailChimp\Campaigns\Content
  • MailChimp\Campaigns\Feedback
  • MailChimp\Conversations\Conversations
  • MailChimp\Ecommerce\Carts
  • MailChimp\Ecommerce\Customers
  • MailChimp\Ecommerce\Ecommerce
  • MailChimp\Ecommerce\Orders
  • MailChimp\Ecommerce\Products
  • MailChimp\FileManager\Files
  • MailChimp\FileManager\Folders
  • MailChimp\Lists\Interests
  • MailChimp\Lists\Lists
  • MailChimp\Lists\Members
  • MailChimp\Lists\MergeFields
  • MailChimp\Lists\Segments
  • MailChimp\Lists\SignupForms
  • MailChimp\Lists\Webhooks
  • MailChimp\MailChimp
  • MailChimp\Reports\Reports
  • MailChimp\TemplateFolders\TemplateFolders
  • MailChimp\Templates\Templates
 1 <?php
 2 namespace MailChimp\CampaignFolders;
 3 
 4 use MailChimp\MailChimp as MailChimp;
 5 
 6 class CampaignFolders extends MailChimp
 7 {
 8 
 9     /**
10      * Get all folders used to organize campaigns.
11      *
12      * Available query fields:
13      * array["fields"]                  array       list of strings of response fields to return
14      * array["exclude_fields"]          array       list of strings of response fields to exclude (not to be used with "fields")
15      * array["count"]                   int         number of records to return
16      * array["offset"]                  int         number of records from a collection to skip.
17      * @param array $query (See Above) OPTIONAL associative array of query parameters.
18      * @return object
19      */
20     public function getCampaignFolders(array $query = [])
21     {
22         return self::execute("GET", "campaign-folders", $query);
23     }
24 
25     /**
26      * Get information about a specific folder used to organize campaigns.
27      *
28      * Available query fields:
29      * array["fields"]                  array       list of strings of response fields to return
30      * array["exclude_fields"]          array       list of strings of response fields to exclude (not to be used with "fields")
31      * @param string $folder_id
32      * @param array $query (See Above) OPTIONAL associative array of query parameters.
33      * @return object
34      */
35     public function getCampaignFolder($folder_id, array $query = [])
36     {
37         return self::execute("GET", "campaign-folders/{$folder_id}", $query);
38     }
39 
40     /**
41      * Create a new campaign folder.
42      *
43      * @param string folder name
44      * @return object
45      */
46     public function createCampaignFolder($folder_name)
47     {
48         $data = ["name" => $folder_name];
49         return self::execute("POST", "campaign-folders", $data);
50     }
51 
52     /**
53      * Update a specific folder used to organize campaigns.
54      *
55      * @param string folder name
56      * @return object
57      */
58     public function updateCampaignFolder($folder_id, $folder_name)
59     {
60         $data = ["name" => $folder_name];
61         return self::execute("PATCH", "campaign-folders/{$folder_id}", $data);
62     }
63 
64     /**
65      * Delete a specific campaign folder, and mark all the campaigns in the folder as ‘unfiled’.
66      *
67      * @param string $folder_id
68      */
69     public function deleteCampaignFolder($folder_id)
70     {
71         return self::execute("DELETE", "campaign-folders/{$folder_id}");
72     }
73 
74 }
75 
API documentation generated by ApiGen