/** * Send a campaign (pass into function the campaign id and send date) * * @param string $campaignid * @param string $confirmation_email * @param string $send_date * @return void * @author Dan Chadwick */ public function send_campaign($campaignid, $confirmation_email, $send_date) { $cm = new CampaignMonitor($this->apikey); // Optional statement to include debugging information in the result $cm->debug_level = 0; // This is the actual call to the method $result = $cm->campaignSend($campaignid, $confirmation_email, $send_date); if (isset($result['Campaign'])) { return true; } else { Kohana::log('error', 'Campaign Monitor Error : ' . $result['Result']['Message']); return false; } }
<?php ini_set('display_errors', 1); error_reporting(E_ALL); require_once 'CMBase.php'; //-----------------------------INPUT PARAMS--------------------------------------- $apikey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $campaignid = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $confirmationEmail = '*****@*****.**'; $sendDate = '2008-02-15 09:00:00'; //------------------------------------------------------------------------------- $cm = new CampaignMonitor($apikey); //Optional statement to include debugging information in the result $cm->debug_level = 1; //This is the actual call to the method $result = $cm->campaignSend($campaignid, $confirmationEmail, $sendDate); echo '<br><br>'; print_r($result); //Print out the debugging info //print_r($cm);