-
Notifications
You must be signed in to change notification settings - Fork 2
/
SmsSenderInterface.php
executable file
·43 lines (39 loc) · 1.26 KB
/
SmsSenderInterface.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
35
36
37
38
39
40
41
42
43
<?php
namespace yetopen\smssender;
/**
* SmsSenderInterface is the interface that should be implemented by mailer classes.
*
* A mailer should mainly support creating and sending [[MessageInterface|mail messages]]. It should
* also support composition of the message body through the view rendering mechanism. For example,
*
* ```php
* Yii::$app->smssender->send(['3333333333'], 'Your text message', 'Sender Name', '+39', );
* ```
*/
interface SmsSenderInterface
{
/**
* @return int
*/
public function getMinTextLength();
/**
* @return int
*/
public function getMaxTextLength();
/**
* Send the message given the phone number and message.
*
* @param array|string $number Recipients phone numbers, without prefix (e.g. +39).
*
* @param string $message Message to send.
*
* @param string|NULL $sender (optional) The sender name.
*
* @param string $prefix (optional) International prefix (e.g. +39).
*
* @param string|NULL $delivery_time (optional) Date-time in which the message will be scheduled to be sent.
*
* @return string $response The response from the API.
*/
public function send($number, $message, $sender = NULL, $prefix = NULL, $delivery_time = NULL);
}