Back to Documentation Overview
campaignTemplates
public static 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 calling login()
- 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" array sections associative array of editable sections in the template that can accept custom HTML when sending a campaign - <?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){
- }
- }
- <?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){
- }
Examples (2)
download example code[1] mcapi_campaignTemplates.php
[2] xml-rpc_campaignTemplates.php
|
Add New Note
User Contributed Notes for
campaignTemplates |
|---|
| No notes, yet... Will you be the first?? |