getTemplates($pageNumber = 1, $perPage = 10); // DISPLAY RESPONSE echo '
'; print_r($response->body); echo ''; /*===================================================================================*/ // Search ALL ITEMS (available from MailWizz 1.4.4) $response = $endpoint->searchTemplates($pageNumber = 1, $perPage = 10, [ 'name' => 'my template name' ]); // DISPLAY RESPONSE echo '
'; print_r($response->body); echo ''; /*===================================================================================*/ // GET ONE ITEM $response = $endpoint->getTemplate('TEMPLATE-UNIQUE-ID'); // DISPLAY RESPONSE echo '
'; print_r($response->body); echo ''; /*===================================================================================*/ // delete template $response = $endpoint->delete('TEMPLATE-UNIQUE-ID'); // DISPLAY RESPONSE echo '
'; print_r($response->body); echo ''; /*===================================================================================*/ // CREATE A NEW TEMPLATE $rand = rand(); $response = $endpoint->create([ 'name' => 'My API template ' . $rand, 'content' => file_get_contents(__DIR__ . '/template-example.html'), //'archive' => file_get_contents(__DIR__ . '/template-example.zip'), 'inline_css' => 'no',// yes|no ]); // DISPLAY RESPONSE echo '
'; print_r($response->body); echo ''; /*===================================================================================*/ // UPDATE A TEMPLATE $response = $endpoint->update('TEMPLATE-UNIQUE-ID', [ 'name' => 'My API template - updated' . $rand, 'content' => file_get_contents(__DIR__ . '/template-example.html'), //'archive' => file_get_contents(__DIR__ . '/template-example.zip'), 'inline_css' => 'no',// yes|no ]); // DISPLAY RESPONSE echo '
'; print_r($response->body); echo '';