<?php require_once dirname(__FILE__) . "/../bulksms/BulkSMS.php"; require_once dirname(__FILE__) . "/../bulksms/AutoRoute.php"; $bulksms = new Blender\Client\BulkSMS(); $USERNAME = "******"; $PASSWORD = "******"; // Login $bulksms->login($USERNAME, $PASSWORD); $autoRoute = new \Blender\Client\AutoRoute($bulksms); //$autoRoute->printRoutes(); $testNumbers = array("61417188345", "44398938433", "12798723829"); foreach ($testNumbers as $recipient) { $routeId = $autoRoute->getRouteId($recipient); echo "Route id for {$recipient}: {$routeId}\n"; }
<?php require_once dirname(__FILE__) . "/../bulksms/BulkSMS.php"; require_once dirname(__FILE__) . "/../bulksms/AutoRoute.php"; $minBalance = 5; $username = "******"; $password = "******"; $alertPhone = "61400000000"; $bulksms = new \Blender\Client\BulkSMS(); $bulksms->login($username, $password); $autoRoute = new \Blender\Client\AutoRoute($bulksms); $balance = $bulksms->getBalance(); if ($balance < $minBalance) { $routeId = $autoRoute->getRouteId($alertPhone); $result = $bulksms->sendSingle("RawMobility", $alertPhone, "Balance Alert: Your current balance is under {$minBalance} ({$balance}), please top up ASAP.", $routeId); } else { echo "All good ({$balance})\n"; }
<?php //use Blender\Client; require_once dirname(__FILE__) . "/bulksms/BulkSMS.php"; // Defaults $USERNAME = "******"; $PASSWORD = "******"; $recipient = "61000000000"; $bulksms = new Blender\Client\BulkSMS(); // Login $bulksms->login($USERNAME, $PASSWORD); # Get Route ID $ROUTE_ID = $bulksms->getRouteIdByCountry("Australia"); // EXAMPLE 1 - Send to single recipient # Uncomment to run // $bulksms->singleRecipient("test", $recipient, "hello <asaf !!esting " . date("H:i:s"), $ROUTE_ID, "reference"); # ---------------------------------------------------------------------------------------------------------------- // EXAMPLE 2 - Send same message to batch $batch = new Blender\Client\BatchMessageSingleBody(); $batch->setOriginator("test"); $batch->setRouteId($ROUTE_ID); $batch->setBody("Batch single <message> in 漢語"); $batch->addMSISDN($recipient); // You can add as many as you like. # Dont filter duplicates - will send two messages to same recipient // $batch->addMSISDN($recipient); // $batch->setFilterDuplicaets(false); # Send to Mailing List // $batch->addMailingList("Mailing-List-Id"); # Send to Contact // $batch->addContact("contact-id")
<?php //use Blender\Client; require_once dirname(__FILE__) . "/../bulksms/BulkSMS.php"; // Defaults $USERNAME = "******"; $PASSWORD = "******"; $recipient = "61000000000"; $bulksms = new Blender\Client\BulkSMS(); // Login $bulksms->login($USERNAME, $PASSWORD); # Get Route ID $ROUTE_ID = $bulksms->getRouteIdByCountry("Australia"); // EXAMPLE 1 - Send to single recipient # Uncomment to run // $bulksms->singleRecipient("test", $recipient, "hello <asaf !!esting " . date("H:i:s"), $ROUTE_ID, "reference"); # ---------------------------------------------------------------------------------------------------------------- // EXAMPLE 2 - Send same message to batch $batch = new Blender\Client\BatchMessageSingleBody(); $batch->setOriginator("test"); $batch->setRouteId($ROUTE_ID); $batch->setBody("Batch single <message> in 漢語"); $batch->addMSISDN($recipient); // You can add as many as you like. # Schedule message for sending later $batch->setSchedule("2017-01-01T15:24:04", "Australia/Melbourne"); # Dont filter duplicates - will send two messages to same recipient // $batch->addMSISDN($recipient); // $batch->setFilterDuplicaets(false); # Send to Mailing List // $batch->addMailingList("Mailing-List-Id");