campaignTemplates(string apikey)
Retrieve all templates defined for your user account
| Section | Campaign Related |
|---|
| Parameters |
|---|
| apikey a valid API Key for your user account. Get by visiting your API dashboard |
| Returns | |
|---|---|
| array | An array of structs, one for each template (see Returned Fields for details) |
| Returned Fields | integer | id | Id of the template | string | name | Name of the template | string | layout | Layout of the template - "basic", "left_column", "right_column", or "postcard" | string | preview_image | If we've generated it, the url of the preview image for the template | array | sections | associative array of editable sections in the template that can accept custom HTML when sending a campaign |
|---|
[1] mcapi_campaignTemplates.php
<?php /** This Example shows how to retrieve a list of your Campaign Templates via the MCAPI class. **/ require_once 'inc/MCAPI.class.php'; require_once 'inc/config.inc.php'; //contains apikey $retval = $api->campaignTemplates(); if ($api->errorCode){ } else { foreach($retval as $tmpl){ } } ?>
[2] xml-rpc_campaignTemplates.php
<?php /** This Example shows how to Retrieve all of your Campaign Templates using the XML-RPC service and do some basic error checking. Note that we are using the PEAR XML-RPC client and recommend others do as well. **/ require_once 'XML/RPC2/Client.php'; require_once 'inc/config.inc.php'; try { $result = $client->campaignTemplates($apikey); foreach($result as $tmpl){ } } catch (XML_RPC2_FaultException $e){ } ?>