=== SFLWA Identity & Tenant Provisioner for Amazon SES ===
Contributors: sflwa
Tags: aws, ses, amazon ses, multi-tenant, dkim
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.3.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automate multi-tenant SES environment provisioning with isolated identity bindings, IAM credentials, DKIM CNAME output, and native status reporting.

== Description ==

**SES Tenant Provisioner by SFLWA** provides agency-grade, automated multi-tenant onboarding and monitoring for Amazon SES using native SES API v2.

Effortlessly provision isolated client tenants, create sending identities, assign default configuration sets, auto-generate dedicated IAM credentials, and monitor client tenant health directly from your WordPress admin dashboard.

### Key Features:
* **Automated Tenant Onboarding:** Creates SES API v2 tenants, creates domain identities, and binds them to specified tenant resources automatically.
* **Automated IAM Provisioning:** Creates dedicated IAM sending users, adds them to your designated sending group, and issues access keys upon setup.
* **Instant DKIM CNAME Records:** Generates short host, fully qualified domain names (FQDN), and CNAME target values with one-click copy buttons.
* **X-SES-TENANT Header Snippet:** Produces ready-to-use WordPress code snippets (`wp_mail` hook) for client site integration.
* **Native Tenant Statistics Dashboard:** Displays current sending status, assigned domain identities, bound configuration sets, and reputation impact warnings across all saved parent accounts.
* **Multi-Account Support:** Easily switch between different parent AWS operator accounts.
* **Zero Additional API Costs:** Designed strictly around native Amazon SES API v2 calls (`ListTenants`, `GetTenant`, `ListTenantResources`) to keep overhead completely free.

== Installation ==

1. Upload the `sflwa-tenant-identity-provisioner-amazon-ses` folder to the `/wp-content/plugins/` directory (or upload the `.zip` archive via **Plugins > Add New**).
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Run `composer install` inside the plugin directory if installing from source to generate the required vendor autoloader (`vendor/autoload.php`).
4. Go to **SES Tenants > AWS Settings** in your WP Admin sidebar.
5. Add your parent AWS Account Operator credentials and default Configuration Set name.

== IAM Operator Policy ==

Your parent AWS Operator user requires an IAM policy permitting SES API v2 tenant management, IAM user provisioning, and STS caller identity verification. 

Attach the following policy to your operator user in AWS IAM:

`
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "SESManagementAndReportingPermissions",
            "Effect": "Allow",
            "Action": [
                "ses:CreateEmailIdentity",
                "ses:GetEmailIdentity",
                "ses:CreateTenant",
                "ses:CreateTenantResourceAssociation",
                "ses:ListTenants",
                "ses:GetTenant",
                "ses:ListTenantResources"
            ],
            "Resource": "*"
        },
        {
            "Sid": "IAMUserAndGroupProvisioning",
            "Effect": "Allow",
            "Action": [
                "iam:CreateUser",
                "iam:AddUserToGroup",
                "iam:CreateAccessKey"
            ],
            "Resource": "*"
        },
        {
            "Sid": "STSCallerIdentity",
            "Effect": "Allow",
            "Action": [
                "sts:GetCallerIdentity"
            ],
            "Resource": "*"
        }
    ]
}
`

== External Services ==

This plugin integrates directly with Amazon Web Services (AWS) via official API calls to provision and monitor Amazon Simple Email Service (SES) resources.

* Service Name: Amazon Simple Email Service (SES) API v2
* Primary Usage: Submits domain and email verification requests, fetches DKIM/DNS records, manages tenant identities, and retrieves account health statistics.
* AWS Terms of Service: https://aws.amazon.com/service-terms/
* AWS Customer Agreement: https://aws.amazon.com/agreement/
* AWS Privacy Notice: https://aws.amazon.com/privacy/


== Screenshots ==

1. **Provision Tenant View:** Simple domain onboarding interface with instant credential, DKIM CNAME, and code snippet outputs.
2. **Tenant Statistics Dashboard:** Native WordPress table overview displaying sending status, associated domain identities, configuration sets, and reputation warnings.
3. **AWS Settings Page:** Management panel for saved parent AWS accounts and configuration set defaults.

== Changelog ==

= 1.3.3 =
* Feature: Added one-click copy buttons for IAM Access Key ID and Secret Access Key upon tenant provisioning.
* Feature: Added dedicated copy button for the WordPress `X-SES-TENANT` mail header snippet.
* Security & Permissions: Automatically attach `AmazonSESFullAccess` managed IAM policy to newly provisioned tenant users to ensure broad compatibility with third-party SMTP plugins.
* Usability: Implemented case-insensitive alphabetical sorting (`uasort`) for AWS Account dropdowns and statistics views.

= 1.3.2 =
* Fix: Resolved admin menu slug collisions across primary and submenu items to maintain full compliance with WordPress Plugin Review Guidelines.
* Optimization: Standardized distribution archiving and pruned unused AWS SDK dependencies to significantly reduce SVN repository package size.
* Core: Refactored option key storage and legacy data migration checks for improved database handling.

= 1.3.1 =
* Feature: Added one-click copy buttons for short host, FQDN, and target values on generated DKIM CNAME DNS records.
* UI: Enqueued dedicated admin inline JavaScript (`sflwa-stp-script`) for seamless clipboard copying interactions.
* Usability: Visual feedback added to copy buttons showing temporary success states upon user interaction.

= 1.3.0 =
* Security & Standards: Fixed output escaping, input unslashing, global scope variable naming, and script enqueue parameters per Plugin Check guidelines.
* UI Enhancement: Separated associated domains and configuration sets into distinct table columns on the Tenant Statistics page.
* Performance: Optimized reporting logic around native SES API v2 calls (`listTenants`, `getTenant`, `listTenantResources`).

= 1.2.0 =
* Standardized dashboard interface to native WordPress admin table styles.
* Added custom inline JavaScript clipboard helpers for DKIM records and header code snippets.

= 1.1.0 =
* Complete plugin rebranding to **SES Tenant Provisioner by SFLWA**.
* Added option database key migration check (`ses_tenant_provisioner_accounts` -> `sflwa_stp_accounts`).

= 1.0.0 =
* Initial release.


== Thank You ==
Thank you to WebCami for your support of my work.
