Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'Aws\Ses\SesClient' not found #43

Open
alikuru opened this issue Oct 6, 2019 · 4 comments · May be fixed by #44
Open

Class 'Aws\Ses\SesClient' not found #43

alikuru opened this issue Oct 6, 2019 · 4 comments · May be fixed by #44

Comments

@alikuru
Copy link

alikuru commented Oct 6, 2019

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?

@henrywright
Copy link

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

@alikuru
Copy link
Author

alikuru commented Oct 6, 2019

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';

@henrywright
Copy link

In a previous version the AWS autoloader was required in SES::get_client(). This was removed when the SDK was removed

@roborourke
Copy link
Contributor

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.

SteveRyan-ASU added a commit to asuengineering/aws-ses-wp-mail that referenced this issue Dec 2, 2021
Borrows language from issue humanmade#43 to explain best practices for installation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants