Postmark\PostmarkClient::getInboundMessages PHP Метод

getInboundMessages() публичный Метод

Get messages sent to the inbound email address associated with this Server.
public getInboundMessages ( integer $count = 100, integer $offset, string $recipient = NULL, string $fromEmail = NULL, string $tag = NULL, string $subject = NULL, string $mailboxHash = NULL, string $status = NULL, string $fromdate = NULL, string $todate = NULL ) : Postmark\Models\DynamicResponseModel
$count integer The number of inbounce messages to retrieve in the request (defaults to 100)
$offset integer The number of messages to 'skip' when 'paging' through messages (defaults to 0)
$recipient string Filter by the message recipient
$fromEmail string Filter by the message sender
$tag string Filter by the message tag
$subject string Filter by the message subject
$mailboxHash string Filter by the mailboxHash
$status string Filter by status ('blocked' or 'processed')
$fromdate string Filter to messages on or after YYYY-MM-DD
$todate string Filter to messages on or before YYYY-MM-DD
Результат Postmark\Models\DynamicResponseModel
    function getInboundMessages($count = 100, $offset = 0, $recipient = NULL, $fromEmail = NULL, $tag = NULL, $subject = NULL, $mailboxHash = NULL, $status = NULL, $fromdate = NULL, $todate = NULL)
    {
        $query = array();
        $query['recipient'] = $recipient;
        $query['fromemail'] = $fromEmail;
        $query['tag'] = $tag;
        $query['subject'] = $subject;
        $query['mailboxhash'] = $mailboxHash;
        $query['count'] = $count;
        $query['status'] = $status;
        $query['offset'] = $offset;
        $query['fromdate'] = $fromdate;
        $query['todate'] = $todate;
        return new DynamicResponseModel($this->processRestRequest('GET', '/messages/inbound', $query));
    }

Usage Example

 function testClientCanGetInboundMessageDetails()
 {
     $tk = parent::$testKeys;
     $client = new PostmarkClient($tk->READ_SELENIUM_TEST_SERVER_TOKEN, $tk->TEST_TIMEOUT);
     $retrievedMessages = $client->getInboundMessages(10);
     $baseMessageId = $retrievedMessages->InboundMessages[0]["MessageID"];
     $message = $client->getInboundMessageDetails($baseMessageId);
     $this->assertNotEmpty($message);
 }