forked from titansys/zender-gateways
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroutee.php
More file actions
45 lines (40 loc) · 1.15 KB
/
routee.php
File metadata and controls
45 lines (40 loc) · 1.15 KB
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
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Routee SMS Gateway
* @url https://www.routee.net
* @author shubra2641 <https://github.com/shubra2641>
*/
define("ROUTEE_GATEWAY", [
"authorization" => "775sb3ee-f02c-43bc-a500-e96e52f09073", // Your routee authorization token
"fromId" => "Zender" // The sender ID you want to use
]);
return [
"send" => function ($phone, $message, &$system) {
/**
* Implement sending here
* @return bool:true
* @return bool:false
*/
$send = $system->guzzle->post("https://connect.routee.net/sms", [
"headers" => [
"Authorization" => "Bearer " . ROUTEE_GATEWAY["authorization"],
"Content-Type" => "application/json"
],
"json" => [
"body" => $message,
"to" => $phone,
"from" => ROUTEE_GATEWAY["fromId"]
],
"allow_redirects" => true,
"http_errors" => false
]);
return $send->getStatusCode() == 200 ? true : false;
},
"callback" => function ($request, &$system) {
/**
* Implement status callback here if gateway supports it
* @return array:MessageID
* @return array:Empty
*/
}
];