1: <?php
2: /**
3: * Preview Send resource
4: *
5: * This resource is not a classic resource in the API, but it is easier
6: * to handle it this way as it simplifies the code.
7: *
8: * It allows to send the preview easily form a message entitiy:
9: * $message->preview_send->post($values);
10: *
11: * @author Yannick Huerre <dev@sheoak.fr>
12: * @copyright 2015 (c) Oasiswork
13: * @license https://opensource.org/licenses/MIT MIT
14: */
15:
16: namespace Crunchmail\Resources;
17:
18: /**
19: * Preview resource class
20: */
21: class PreviewSendResource extends GenericResource
22: {
23: public function send($recipients)
24: {
25: $recipients = is_array($recipients) ? $recipients : [ $recipients ];
26: $values = ['to' => implode(',', $recipients) ];
27:
28: // sending the preview via crunchmail API
29: return $this->post($values);
30: }
31: }
32: