PHP code example of leedohyung-dba / ses-topic-sniffer

1. Go to this page and download the library: Download leedohyung-dba/ses-topic-sniffer 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/ */

    

leedohyung-dba / ses-topic-sniffer example snippets


use SesTopicSniffer\SesTopicSniffer;

$this->SesTopicSniffer = SesTopicSniffer::getInstance($snsRequestData->Message);
if (empty($this->SesTopicSniffer)) {
    return;
}

if ($this->SesTopicSniffer->isNotFactOrEqualSesStd()) {
    $this->sesStdStatusCtlHandler();
} else {
    $this->realStatusCtlHandler();
}

// get info the ses standard status
$this->SesTopicSniffer->sesStdStatus

// get info the real status
$this->SesTopicSniffer->realStatus

// messageId
$this->SesTopicSniffer->mail->messageId

// email address
$this->SesTopicSniffer->mail->destination[0]

SesTopicSniffer::UNDEFINED_BOUNCE_STATUS_CODE
SesTopicSniffer::SOFT_BOUNCE_STATUS_CODE
SesTopicSniffer::HARD_BOUNCE_STATUS_CODE

SesTopicSniffer::COMPLAINT_STATUS_CODE
SesTopicSniffer::SOFT_COMPLAINT_STATUS_CODE
SesTopicSniffer::HARD_COMPLAINT_STATUS_CODE

SesTopicSniffer::DELIVERY_STATUS_CODE

// $this->SesTopicSniffer->mail
(
    [timestamp] => 2017-08-08T12:07:11.000Z
    [source] => =?utf-8?B?c2lnZnk=?= <[email protected]>
    [sourceArn] => arn:aws:ses:us-west-2:278359588002:identity/sigfy.jp
    [sourceIp] => 54.64.122.239
    [sendingAccountId] => 278359588002
    [messageId] => 0101015dc1bdd93f-f7b8d7ab-681d-4954-a8c2-7272673180cd-000000
    [destination] => Array
        (
            [0] => [email protected]
        )

)