Overview

Namespaces

  • Crunchmail
    • Collections
    • Entities
    • Exception
    • PHPUnit
    • Resources

Classes

  • Crunchmail\Client
  • Crunchmail\Collections\GenericCollection
  • Crunchmail\Entities\AttachmentEntity
  • Crunchmail\Entities\ContactEntity
  • Crunchmail\Entities\ContactListEntity
  • Crunchmail\Entities\ContactQueueEntity
  • Crunchmail\Entities\DomainEntity
  • Crunchmail\Entities\GenericEntity
  • Crunchmail\Entities\MessageEntity
  • Crunchmail\Entities\RecipientEntity
  • Crunchmail\PHPUnit\IsEntityConstraint
  • Crunchmail\PHPUnit\IsGenericCollectionConstraint
  • Crunchmail\PHPUnit\IsGenericEntityConstraint
  • Crunchmail\PHPUnit\IsGenericResourceConstraint
  • Crunchmail\PHPUnit\IsResourceConstraint
  • Crunchmail\PHPUnit\TestCase
  • Crunchmail\Resources\DomainsResource
  • Crunchmail\Resources\GenericResource
  • Crunchmail\Resources\PreviewSendResource

Exceptions

  • Crunchmail\Exception\ApiException
  • Overview
  • Namespace
  • Class
 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: 
API documentation generated by ApiGen