CampaignMonitor::getTemplates PHP Method

getTemplates() public method

http://www.campaignmonitor.com/api/clients/#getting_client_templates
public getTemplates ( string[optional] $clientId = null ) : array
$clientId string[optional]
return array
    public function getTemplates($clientId = null)
    {
        // set ID
        $clientId = empty($clientId) ? $this->getClientId() : $clientId;
        // make the call
        $records = (array) $this->doCall('clients/' . $clientId . '/templates');
        // stop here if no records were set
        if (empty($records)) {
            return array();
        }
        // reserve variables
        $results = array();
        // loop the records
        foreach ($records as $key => $record) {
            $results[$key]['id'] = $record['TemplateID'];
            $results[$key]['name'] = $record['Name'];
            $results[$key]['preview_url'] = $record['PreviewURL'];
            $results[$key]['screenshot_url'] = $record['ScreenshotURL'];
        }
        // return the records
        return $results;
    }