Download the PHP package peternijssen/ses-configuration without Composer
On this page you can find all versions of the php package peternijssen/ses-configuration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download peternijssen/ses-configuration
More information about peternijssen/ses-configuration
Files in peternijssen/ses-configuration
Package ses-configuration
Short Description Package to manage SES configuration. It does not send actual emails!
License MIT
Informations about the package ses-configuration
SES Configuration
Package to manage SES configuration. It does not send actual emails!
Install
Using Composer:
$ composer require peternijssen/ses-configuration
Testing
To run all unit tests, use the locally installed PHPUnit:
$ ./vendor/bin/phpunit
Usage
AWS SES Client
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.
Identities
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("[email protected]");
Manager
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();