Skip to content

Instantly share code, notes, and snippets.

@freretuc
Created April 1, 2018 11:45
Show Gist options
  • Save freretuc/9041bf7a375a6fb5cdc166fb61bd451d to your computer and use it in GitHub Desktop.
Save freretuc/9041bf7a375a6fb5cdc166fb61bd451d to your computer and use it in GitHub Desktop.
Simple OVH API SMS
<?php
// include https://gist.github.com/freretuc/bb98f3339ccae5ac91aaea04473df4db
function sendSMS($phone, $message) {
$url = "/sms/sms-xxxxxxxx-y/jobs";
$destinataires = array();
$destinataires[] = $phone;
$data = array();
$data['charset'] = "UTF-8";
$data['class'] = "phoneDisplay";
$data['coding'] = "7bit";
$data['receivers'][] = $phone;
$data['message'] = $message;
$data['noStopClause'] = true;
$data['sender'] = "__OVH_SENDER__";
$return = ovh_post($url, $data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment