Package to manage SES configuration. It does not send actual emails!
Using Composer:
$ composer require peternijssen/ses-configuration
To run all unit tests, use the locally installed PHPUnit:
$ ./vendor/bin/phpunit
You have to begin with creating a SesClient
$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.
First you have to determine you are using an Email identity or Domain identity. You can then use the appropriate object;
$identity = new DomainIdentity("peternijssen.nl");
or
$identity = new EmailIdentity("peter@peternijssen.nl");
Next you have to use the correct manager;
$manager = new DomainManager($sesClient, $identity);
or
$manager = new EmailManager($sesClient, $identity);
From here, you can do several requests;
Create the new identity within SES
$manager->create();
Fetch the status (Pending|Success|Failed|TemporaryFailure|NotStarted)
$manager->fetchStatus();
Fetch the DKIM status (Pending|Success|Failed|TemporaryFailure|NotStarted)
$manager->fetchDkimStatus();
Fetch the DNS changes (Domain only!)
$manager->fetchRecord();
Fetch the DKIM DNS changes
$manager->fetchDkimRecords();
Request to verify the DKIM changes
$manager->verifyDkim();
Request to Enable DKIM
$manager->enableDkim();
Request to Disable DKIM
$manager->disableDkim();