echo '<pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // GET ONE ITEM $response = $endpoint->getCampaign('CAMPAIGN-UNIQUE-ID'); // DISPLAY RESPONSE echo '<pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // CREATE CAMPAIGN $response = $endpoint->create(array('name' => 'My API Campaign', 'from_name' => 'John Doe', 'subject' => 'Hey, i am testing the campaigns via API', 'reply_to' => '*****@*****.**', 'send_at' => date('Y-m-d H:i:s', strtotime('+1 hour')), 'list_uid' => 'LIST-UNIQUE-ID', 'segment_uid' => 'SEGMENT-UNIQUE-ID', 'template' => array('content' => file_get_contents(dirname(__FILE__) . '/template-example.html'), 'inline_css' => 'no'))); // DISPLAY RESPONSE echo '<hr /><pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // UPDATE CAMPAIGN $response = $endpoint->update('CAMPAIGN-UNIQUE-ID', array('name' => 'My API Campaign UPDATED', 'from_name' => 'John Doe', 'subject' => 'Hey, i am testing the campaigns via API', 'reply_to' => '*****@*****.**', 'send_at' => date('Y-m-d H:i:s', strtotime('+1 hour')), 'list_uid' => 'LIST-UNIQUE-ID', 'segment_uid' => 'SEGMENT-UNIQUE-ID', 'template' => array('content' => file_get_contents(dirname(__FILE__) . '/template-example.html'), 'inline_css' => 'no'))); // DISPLAY RESPONSE echo '<hr /><pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // Delete CAMPAIGN $response = $endpoint->delete('CAMPAIGN-UNIQUE-ID'); // DISPLAY RESPONSE echo '<hr /><pre>'; print_r($response->body); echo '</pre>';
// GET ONE ITEM $response = $endpoint->getCampaign('CAMPAIGN-UNIQUE-ID'); // DISPLAY RESPONSE echo '<pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // CREATE CAMPAIGN $response = $endpoint->create(array('name' => 'My API Campaign', 'type' => 'regular', 'from_name' => 'John Doe', 'from_email' => '*****@*****.**', 'subject' => 'Hey, i am testing the campaigns via API', 'reply_to' => '*****@*****.**', 'send_at' => date('Y-m-d H:i:s', strtotime('+10 hours')), 'list_uid' => 'LIST-UNIQUE-ID', 'segment_uid' => 'SEGMENT-UNIQUE-ID', 'options' => array('url_tracking' => 'no', 'json_feed' => 'no', 'xml_feed' => 'no', 'plain_text_email' => 'yes', 'email_stats' => null), 'template' => array('content' => file_get_contents(dirname(__FILE__) . '/template-example.html'), 'inline_css' => 'no', 'plain_text' => null, 'auto_plain_text' => 'yes'))); // DISPLAY RESPONSE echo '<hr /><pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // UPDATE CAMPAIGN $response = $endpoint->update('CAMPAIGN-UNIQUE-ID', array('name' => 'My API Campaign UPDATED', 'from_name' => 'John Doe', 'from_email' => '*****@*****.**', 'subject' => 'Hey, i am testing the campaigns via API', 'reply_to' => '*****@*****.**', 'send_at' => date('Y-m-d H:i:s', strtotime('+1 hour')), 'list_uid' => 'LIST-UNIQUE-ID', 'segment_uid' => 'SEGMENT-UNIQUE-ID', 'options' => array('url_tracking' => 'no', 'json_feed' => 'no', 'xml_feed' => 'no', 'plain_text_email' => 'yes', 'email_stats' => null), 'template' => array('content' => file_get_contents(dirname(__FILE__) . '/template-example.html'), 'inline_css' => 'no', 'plain_text' => null, 'auto_plain_text' => 'yes'))); // DISPLAY RESPONSE echo '<hr /><pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // Copy CAMPAIGN $response = $endpoint->copy('CAMPAIGN-UNIQUE-ID'); // DISPLAY RESPONSE echo '<hr /><pre>'; print_r($response->body); echo '</pre>'; /*===================================================================================*/ // Pause/Unpause CAMPAIGN $response = $endpoint->pauseUnpause('CAMPAIGN-UNIQUE-ID'); // DISPLAY RESPONSE