-
Notifications
You must be signed in to change notification settings - Fork 0
/
Send SMS Example.php
31 lines (24 loc) · 945 Bytes
/
Send SMS Example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require_once(__DIR__."/lib/AdnSmsNotification.php");
use AdnSms\AdnSmsNotification;
$digits = 5;
$randnumber = rand(pow(10, $digits-1), pow(10, $digits)-1);
$message = "Verify code is: ".$randnumber;
$recipient="8801843******"; // For SINGLE_SMS or OTP (Set Mobile Number)
$requestType = 'OTP'; // options available: "SINGLE_SMS", "OTP"
$messageType = 'UNICODE'; // options available: "TEXT", "UNICODE"
/*
* Sending Single SMS or OTP with sendSms() method
* ----------
* Params:
* ----------
* $requestType : Required, Must contain any of the two values: "SINGLE_SMS", "OTP"
* $message : Required
* $recipient : Required
* $messageType : Must contain any of the two values: "TEXT", "UNICODE"
*/
//Balance
//$smsNotification = new AdnSmsNotification();
//$smsNotification->checkBalance();
$sms = new AdnSmsNotification();
echo $sms->sendSms($requestType, $message, $recipient, $messageType);