Skip to content

Commit 85aac9c

Browse files
fix: pass options parameter
1 parent 09827a5 commit 85aac9c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

src/classes/Sms.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ function sendMore($sender, $recipients, $text, $transaction = false, $priority =
7575
$param['recipients'] = $recipients;
7676
$param['body'] = $text;
7777
$param['transaction'] = $transaction;
78-
if($options != NULL){
79-
$param['priority'] = $priority;
78+
$param['priority'] = $priority;
79+
if(sizeof($options)){
80+
$param['options'] = $options;
8081
}
82+
8183
try{
8284
$data = $this->connect("messages/", "POST", $param);
8385
if(isset($data->data[0]) && $transaction){
@@ -94,8 +96,10 @@ function sendMore($sender, $recipients, $text, $transaction = false, $priority =
9496
}
9597
}
9698

97-
98-
function sendOne($sender, $recipient, $text, $prefix = NULL, $priority = 1,$options = NULL, $test = false){
99+
/**
100+
* @param number $priority un moltiplicatore per la priorita di invio
101+
*/
102+
function sendOne($sender, $recipient, $text, $prefix = NULL, $priority = 1,$options = [], $test = false){
99103
if($prefix != NULL){
100104
$recipient = $prefix."-".$recipient;
101105
}
@@ -105,8 +109,9 @@ function sendOne($sender, $recipient, $text, $prefix = NULL, $priority = 1,$opti
105109
$param['recipients'] = $recipient;
106110
$param['body'] = $text;
107111
$param['transaction'] = FALSE;
108-
if($options != NULL){
109-
$param['priority'] = $priority;
112+
$param['priority'] = $priority;
113+
if(sizeof($options)){
114+
$param['options'] = $options;
110115
}
111116

112117
try{

0 commit comments

Comments
 (0)