Class 'Aws\Ses\SesClient' not found
Opened this issue · 4 comments
Updated wp-config.php
and ran composer install
; getting this error while testing with wp-cli
:
PHP Fatal error: Uncaught Error: Class 'Aws\Ses\SesClient' not found in /var/www/domain.tld/http/wp-content/plugins/aws-ses-wp-mail/inc/class-ses.php:230
Any ideas what am I doing wrong?
I just tried and I get exactly the same error as you did.
git clone https://github.com/humanmade/aws-ses-wp-mail.git aws-ses-wp-mail
cd aws-ses-wp-mail
composer install
The plugin is active and the constants are set in wp-config.php
OK, added this line on the top for composer
auto-loading and now I am able to send with wp-cli
:
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
In a previous version the AWS autoloader was required in SES::get_client(). This was removed when the SDK was removed
This was intentionally removed in #41 as it wasn't easy to keep it up to date.
The ideal approach is to install plugins like this via composer, rather than installing composer dependencies per plugin e.g.:
composer require humanmade/aws-ses-wp-mail
Then you could include your project's root level vendor/autoload.php
in wp-config.php
for example. This means if you have multiple plugins making use of the AWS SDK (such as S3 Uploads) it only needs one shared copy of the SDK in your codebase.