PHP code example of wecreatesolutions / postmark-inbound

1. Go to this page and download the library: Download wecreatesolutions/postmark-inbound library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wecreatesolutions / postmark-inbound example snippets


$message = \WeCreateSolutions\PostmarkInbound\Message::fromPostmarkJson($postmarkJson);

$message = \WeCreateSolutions\PostmarkInbound\Message::fromPostmarkJson($postmarkJson);
$headers = $message->getHeaders();
foreach ($headers as $header) {
    echo $header->name . ': ' . $header->value . PHP_EOL;
}

$message = \WeCreateSolutions\PostmarkInbound\Message::fromPostmarkJson($postmarkJson);
$header = $message->getHeaderByName('X-Spam-Status');
if (null !== $header) {
    echo $header->name . ': ' . $header->value . PHP_EOL;
}

$message = \WeCreateSolutions\PostmarkInbound\Message::fromPostmarkJson($postmarkJson);
$cc = $message->getCc();
foreach ($cc as $contact) {
    echo $contact->name . ': ' . $contact->email . PHP_EOL;
}