-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsms.php
34 lines (30 loc) · 1.36 KB
/
sms.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
32
33
34
<?php
function notify_woosms_send_sms($mobilenumber, $smsbodytext){
$options = get_option( 'notify_woosms_settings' );
$body = array(
'recipient' => $mobilenumber,
'sender' => $options['notify_woosms_api_mask'],
'body' => $smsbodytext,
'userid' => $options['notify_woosms_api_user_name'],
'password' => $options['notify_woosms_api_password']
);
$args = array(
'body' => $body,
'timeout' => '5',
'redirection' => '5',
'httpversion' => '1.0',
'blocking' => true,
'headers' => array(),
'cookies' => array()
);
if ($options['notify_woosms_select_provider'] == 'dianahost_psms') {
$response = wp_remote_post( 'https://psms.dianahost.com/api/sms/v1/send', $args );
} elseif ($options['notify_woosms_select_provider'] == 'dianahost_esms') {
$apikey = $options['notify_woosms_api_key'];
$response = wp_remote_post( 'http://esms.hostdokan.com/smsapi?api_key='.$apikey.'&type=text&contacts='.$mobilenumber.'&msg='.$smsbodytext.'&senderid='.$options['notify_woosms_api_mask'] );
} elseif ($options['notify_woosms_select_provider'] == 'dianahost_gsms') {
$apikey = $options['notify_woosms_api_key'];
$response = wp_remote_post( 'http://gsms.pw/smsapi?api_key='.$apikey.'&type=text&contacts='.$mobilenumber.'&msg='.$smsbodytext.'&senderid='.$options['notify_woosms_api_mask'] );
}
return false;
}