1 | <?php |
||
14 | class Sms |
||
15 | { |
||
16 | protected $smsData = [ |
||
17 | 'to' => null, |
||
18 | 'templates' => [], |
||
19 | 'templateData' => [], |
||
20 | 'content' => null |
||
21 | ]; |
||
22 | |||
23 | protected $agent; |
||
24 | |||
25 | protected $config; |
||
26 | |||
27 | public function __construct($config) |
||
31 | |||
32 | /** |
||
33 | * Get all the data of SMS/voice verify. |
||
34 | * |
||
35 | * @param null|string $name |
||
36 | * |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function getData($name = null) |
||
46 | |||
47 | /** |
||
48 | * send mobile |
||
49 | * @param $mobile |
||
50 | * @return $this |
||
51 | */ |
||
52 | public function to($mobile) |
||
57 | |||
58 | /** |
||
59 | * send content for part of sms-providers support content-sms |
||
60 | * @param $content |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function content($content) |
||
68 | |||
69 | /** |
||
70 | * set template-id for part of sms-providers support template-sms |
||
71 | * @param $agentName |
||
72 | * @param null $tempId |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function template($agentName='SMS_AGENT', $tempId = null) |
||
92 | |||
93 | /** |
||
94 | * set template-data for part of sms-providers support template-sms |
||
95 | * @param array $data |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function data(array $data) |
||
103 | |||
104 | /** |
||
105 | * @return mixed |
||
106 | * @throws \Exception |
||
107 | */ |
||
108 | public function send() |
||
117 | } |