6
6
class Smsir
7
7
{
8
8
/**
9
- * This method used for log the messages to the database if db-log set to true.
9
+ * This method used for log the messages to the database if db-log set to true (@ smsir.php in config folder) .
10
10
*
11
11
* @param $result
12
12
* @param $messages
@@ -45,7 +45,7 @@ public static function DBlog($result, $messages, $numbers) {
45
45
}
46
46
47
47
/**
48
- * this method use in every request to get the token at first.
48
+ * this method used in every request to get the token at first.
49
49
*
50
50
* @return mixed - the Token for use api
51
51
*/
@@ -58,7 +58,7 @@ public static function getToken()
58
58
}
59
59
60
60
/**
61
- * this method return your credit in sms.ir
61
+ * this method return your credit in sms.ir (sms credit, not money)
62
62
*
63
63
* @return mixed - credit
64
64
*/
@@ -69,14 +69,26 @@ public static function credit()
69
69
return json_decode ($ result ->getBody (),true )['Credit ' ];
70
70
}
71
71
72
+ /**
73
+ * by this method you can fetch all of your sms lines.
74
+ *
75
+ * @return mixed , return all of your sms lines
76
+ */
77
+ public static function getLines ()
78
+ {
79
+ $ client = new Client ();
80
+ $ result = $ client ->get ('http://restfulsms.com/api/SMSLine ' ,['headers ' =>['x-sms-ir-secure-token ' =>self ::getToken ()],'connect_timeout ' =>30 ]);
81
+ return json_decode ($ result ->getBody (),true );
82
+ }
83
+
72
84
/**
73
85
* Simple send message with sms.ir account and line number
74
86
*
75
87
* @param $messages = Messages - Count must be equal with $numbers
76
88
* @param $numbers = Numbers - must be equal with $messages
77
89
* @param null $sendDateTime = dont fill it if you want to send message now
78
90
*
79
- * @return mixed
91
+ * @return mixed, return status
80
92
*/
81
93
public static function send ($ messages ,$ numbers ,$ sendDateTime = null )
82
94
{
@@ -120,6 +132,8 @@ public static function addToCustomerClub($prefix,$firstName,$lastName,$mobile,$b
120
132
}
121
133
122
134
/**
135
+ * this method send message to your customer club contacts (known as white sms module)
136
+ *
123
137
* @param $messages
124
138
* @param $numbers
125
139
* @param null $sendDateTime
@@ -146,6 +160,8 @@ public static function sendToCustomerClub($messages,$numbers,$sendDateTime = nul
146
160
}
147
161
148
162
/**
163
+ * this method add contact to the your customer club and then send a message to him/her
164
+ *
149
165
* @param $prefix
150
166
* @param $firstName
151
167
* @param $lastName
@@ -168,6 +184,8 @@ public static function addContactAndSend($prefix,$firstName,$lastName,$mobile,$m
168
184
}
169
185
170
186
/**
187
+ * this method send a verification code to your customer. need active the module at panel first.
188
+ *
171
189
* @param $code
172
190
* @param $number
173
191
*
@@ -187,6 +205,8 @@ public static function sendVerification($code,$number,$log = false)
187
205
}
188
206
189
207
/**
208
+ * this method used for fetch received messages
209
+ *
190
210
* @param $perPage
191
211
* @param $pageNumber
192
212
* @param $formDate
@@ -203,10 +223,12 @@ public static function getReceivedMessages($perPage,$pageNumber,$formDate,$toDat
203
223
}
204
224
205
225
/**
206
- * @param $perPage
207
- * @param $pageNumber
208
- * @param $formDate
209
- * @param $toDate
226
+ * this method used for fetch your sent messages
227
+ *
228
+ * @param $perPage = how many sms you want to fetch in every page
229
+ * @param $pageNumber = the page number
230
+ * @param $formDate = from date
231
+ * @param $toDate = to date
210
232
*
211
233
* @return mixed
212
234
*/
0 commit comments