SES Configuration
, (*1)
, (*2)
Package to manage SES configuration. It does not send actual emails!, (*3)
Install
Using Composer:, (*4)
$ composer require peternijssen/ses-configuration
Testing
To run all unit tests, use the locally installed PHPUnit:, (*5)
$ ./vendor/bin/phpunit
Usage
AWS SES Client
You have to begin with creating a SesClient, (*6)
$sesClient = new \Aws\Ses\SesClient([
'region' => 'us-west-2',
'version' => 'latest',
'credentials' => [
'key' => 'key',
'secret' => 'secret',
],
]);
warning: It's not recommended to store your AWS credentials within the application itself. Please make sure your server has access through policies., (*7)
Identities
First you have to determine you are using an Email identity or Domain identity. You can then use the appropriate object;, (*8)
$identity = new DomainIdentity("peternijssen.nl");
or, (*9)
$identity = new EmailIdentity("peter@peternijssen.nl");
Manager
Next you have to use the correct manager;, (*10)
$manager = new DomainManager($sesClient, $identity);
or, (*11)
$manager = new EmailManager($sesClient, $identity);
From here, you can do several requests;, (*12)
Create the new identity within SES, (*13)
$manager->create();
Fetch the status (Pending|Success|Failed|TemporaryFailure|NotStarted), (*14)
$manager->fetchStatus();
Fetch the DKIM status (Pending|Success|Failed|TemporaryFailure|NotStarted), (*15)
$manager->fetchDkimStatus();
Fetch the DNS changes (Domain only!), (*16)
$manager->fetchRecord();
Fetch the DKIM DNS changes, (*17)
$manager->fetchDkimRecords();
Request to verify the DKIM changes, (*18)
$manager->verifyDkim();
Request to Enable DKIM, (*19)
$manager->enableDkim();
Request to Disable DKIM, (*20)
$manager->disableDkim();