Skip to content

Instantly share code, notes, and snippets.

@benmmurphy
Last active March 8, 2016 12:15
Show Gist options
  • Save benmmurphy/c8e3e592b17158adf24e to your computer and use it in GitHub Desktop.
Save benmmurphy/c8e3e592b17158adf24e to your computer and use it in GitHub Desktop.
<?php
$client = new ZenSend\Client(API_KEY);
$request = new ZenSend\SmsRequest();
$request->body = "Please enter " . $token . " to verify your mobile number";
$request->originator = "VERIFY";
$request->numbers = [$_POST["msisdn"]];
try {
$result = $client->send_sms($request);
} catch (ZenSend\ZenSendException $e) {
if ($e->parameter == "NUMBERS") {
$error = "number";
} else {
$error = "generic";
}
include("number_verify_form.inc");
return;
} catch (ZenSend\NetworkException $e) {
$error = "generic";
include("choose_number_form.inc");
return;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment