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) |
||
47 | |||
48 | /** |
||
49 | * send mobile. |
||
50 | * |
||
51 | * @param $mobile |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function to($mobile) |
||
61 | |||
62 | /** |
||
63 | * send content for part of sms-providers support content-sms. |
||
64 | * |
||
65 | * @param $content |
||
66 | * |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function content($content) |
||
75 | |||
76 | /** |
||
77 | * set template-id for part of sms-providers support template-sms. |
||
78 | * |
||
79 | * @param $agentName |
||
80 | * @param null $tempId |
||
81 | * |
||
82 | * @return $this |
||
83 | */ |
||
84 | public function template($agentName = 'SMS_AGENT', $tempId = null) |
||
102 | |||
103 | /** |
||
104 | * set template-data for part of sms-providers support template-sms. |
||
105 | * |
||
106 | * @param array $data |
||
107 | * |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function data(array $data) |
||
116 | |||
117 | /** |
||
118 | * @throws \Exception |
||
119 | * |
||
120 | * @return mixed |
||
121 | */ |
||
122 | public function send() |
||
136 | } |
||
137 |