Created
April 1, 2018 11:45
-
-
Save freretuc/9041bf7a375a6fb5cdc166fb61bd451d to your computer and use it in GitHub Desktop.
Simple OVH API SMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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