peternijssen/ses-configuration

This package is abandoned and no longer maintained. No replacement package was suggested.

Package to manage SES configuration. It does not send actual emails!

1.0.0 2016-02-03 21:45 UTC

This package is not auto-updated.

Last update: 2020-08-21 20:26:37 UTC


README

Author Build Status Coverage Status Quality Score Software License Packagist Version Total Downloads

SensioLabsInsight

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("peter@peternijssen.nl");

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();