Campaign delivery is scheduled. Time is set according GMT, but if a specific time zone needs to be set up, required number of hours have to be added or subtracted. Time is written in YYYY-MM-DD HH:II:SS +GMT format. Example of time format: ‘2020-05-18 11:59:21 +0100’, where ‘+0100’ is an added hour to the standard time.

campaignSchedule(string $cid, string $schedule_time) : boolean
Input parameters
  • cid - campaign ID
  • schedule_time - sending time (according to GMT)

Information obtained
  • true, if scheduling has succeeded. Otherwise, an error message is returned.


campaignSchedule($cid, $schedule_time);
header("Content-Type: text/plain");
if ($api->errorCode) {
    echo "Unable to load campaignSchedule()!\n";
    echo "\tCode=" . $api->errorCode . "\n";
    echo "\tMsg=" . $api->errorMessage . "\n";
} else {
    echo "Campaign Scheduled to be delivered $schedule_time!\n";
 new xmlrpcval($apikey),
                    'cid' => new xmlrpcval($campaignId),
                    'schedule_time' => new xmlrpcval($schedule_time)
$f = new xmlrpcmsg('campaignSchedule', array($v));
$c = new xmlrpc_client($apiUrl["path"], $apiUrl['host'], 80);
$r = &$c->send($f);
header("Content-Type: text/plain");
if (!$r->faultCode()) {
    $retval = php_xmlrpc_decode($r->value());
    echo "Campaign Scheduled to be delivered $schedule_time!\n";
} else {
    echo "Unable to run campaignSchedule()!\n";
    echo "\tCode=" . $r->faultCode() . "\n";
    echo "\tMsg=" . $r->faultString() . "\n";
from lib.config import * #contains apikey
from lib.MGAPI import MGAPI
# This Example shows how to ping using the MGAPI.php class and do some basic error checking.
api = MGAPI(apikey)
cid = campaignId
schedule_time = '2020-05-18 11:59:21'
retval = api.campaignSchedule(cid, schedule_time)
if api.errorCode:
    print "Unable to load campaignSchedule()!"
    print "\tCode=", api.errorCode
    print "\tMsg=", api.errorMessage
    print "Campaign Scheduled to be delivered %s!" % (schedule_time)

© 2010-2020 Mailigen. All rights reserved.