@@ 150-166 (lines=17) @@ | ||
147 | * |
|
148 | * @return mixed |
|
149 | */ |
|
150 | public function sendLists($params, $simulate = false) |
|
151 | { |
|
152 | $path = sprintf('%s/send/lists', $this->endpoint); |
|
153 | if ($simulate) { |
|
154 | $path .= '/simulate'; |
|
155 | } |
|
156 | ||
157 | // Http request |
|
158 | $response = $this->adapter->post($path, $params); |
|
159 | ||
160 | // Result |
|
161 | if ($this->content_type == 'application/json') { |
|
162 | return json_decode($response); |
|
163 | } else { |
|
164 | return $response; |
|
165 | } |
|
166 | } |
|
167 | ||
168 | /** |
|
169 | * Cancel the sending with selected id. |
|
@@ 209-225 (lines=17) @@ | ||
206 | * |
|
207 | * @return mixed |
|
208 | */ |
|
209 | public function getContactList($id = null) |
|
210 | { |
|
211 | $path = sprintf('%s/send', $this->endpoint); |
|
212 | if ($id) { |
|
213 | $path .= sprintf('/%d', $id); |
|
214 | } |
|
215 | ||
216 | // Http request |
|
217 | $response = $this->adapter->get($path); |
|
218 | ||
219 | // Result |
|
220 | if ($this->content_type == 'application/json') { |
|
221 | return json_decode($response); |
|
222 | } else { |
|
223 | return $response; |
|
224 | } |
|
225 | } |
|
226 | ||
227 | /** |
|
228 | * Remove duplicated contacts from list. |