diff --git a/README.md b/README.md index 60a01a6..6248798 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,21 @@ AWS SES is a very simple UI-less plugin for sending `wp_mail()`s email via AWS SES. -Getting Set Up +Installation ========== -Once you have `git clone`d the repo, or added it as a Git Submodule, add the following constants to your `wp-config.php`: +The ideal approach for using this plugin is to install it via composer at the root of your project. This can prevent multiple versions of the Amazon SDK from being installed within your codebase. + +``` +composer require humanmade/aws-ses-wp-mail +``` + +Otherwise, clone the plugin to `/wp-content/plugins` and then run `composer install` within the resulting directory. + +Configuration +========== + +Once installed, add the following constants to your `wp-config.php`: ```PHP define( 'AWS_SES_WP_MAIL_REGION', 'us-east-1' ); diff --git a/aws-ses-wp-mail.php b/aws-ses-wp-mail.php index 36f60cd..bd7526d 100644 --- a/aws-ses-wp-mail.php +++ b/aws-ses-wp-mail.php @@ -14,6 +14,12 @@ return; } +// Access to the Amazon SDK is required for this plugin to send mail. +// It can be provided directly via composer install within this plugin, or as a dependency of your project. +if ( is_readable( dirname( __FILE__ ) . '/vendor/autoload.php' ) ) { + require_once dirname( __FILE__ ) . '/vendor/autoload.php'; +} + require_once dirname( __FILE__ ) . '/inc/class-ses.php'; if ( defined( 'WP_CLI' ) && WP_CLI ) {