-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/aws ses #3
Conversation
composer.json
Outdated
@@ -24,7 +29,8 @@ | |||
}, | |||
"require-dev": { | |||
"phpunit/phpunit": "^5.2", | |||
"squizlabs/php_codesniffer": "^2.3" | |||
"squizlabs/php_codesniffer": "^2.3", | |||
"aws/aws-sdk-php": "^3.36" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SES is a very old service and as a consequence I think we should not be as tight in the dependency. I think a slightly lower version should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I need 3.36.25 because of templated email management
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Let's keep it this way then.
composer.json
Outdated
@@ -41,6 +47,10 @@ | |||
"cs-fix": "phpcbf", | |||
"test": "phpunit" | |||
}, | |||
"config": { | |||
"sort-packages": true, | |||
"bin-dir": "bin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why changing that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I prefer like this but if you want I can remove it ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is not a useful change :p.
README.md
Outdated
```php | ||
return [ | ||
'zfr_mail' => [ | ||
'aws_ses' => [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend you to make this package with an optional dependency to https://github.com/zf-fr/zfr-aws-utils
This is actually a super lightweight library that integrates with AWS, and allows you to set that kind of config:
return [
'aws' => [
// AWS config
]
]
and then allow to get a client:
$sdk = $container->get(Aws\Sdk::class);
$ses = $sdk->createSesClient();
This has the advantage to centralize all AWS config into a single config key and therefore avoid having it defined for each library that uses a client.
So I suggest:
- Add this library as a "suggested" library
- Update documentation to indicate that SES requires usage of this library
- Update doucmenttaion for the config
What do you think? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good but ZfrAwsUtils has references to Zend Service Manager with ConfigAbstractFactory key ><. For now I just want to be PSR compliant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZfrAwsUtils has no required dependency against Zend Service Manager: https://github.com/zf-fr/zfr-aws-utils/blob/master/composer.json#L22 and the factory to create the client is 100% PSR compliant so can be re-used with anything: https://github.com/zf-fr/zfr-aws-utils/blob/master/src/Container/SdkFactory.php :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok ok I made the change :p
src/Container/SesClientFactory.php
Outdated
@@ -0,0 +1,28 @@ | |||
<?php | |||
|
|||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't use it anywhere in the library so for consistency I'd suggest you get rid of this.
src/Mailer/AwsSesMailer.php
Outdated
*/ | ||
class AwsSesMailer implements MailerInterface | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove useless empty line.
…e and remove config key from composer.json
composer.json
Outdated
@@ -25,15 +25,15 @@ | |||
"require": { | |||
"php": "^7.0", | |||
"guzzlehttp/guzzle": "^6.0", | |||
"psr/container": "^1.0" | |||
"psr/container": "^1.0", | |||
"zfr/zfr-aws-utils": "^1.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it’s not needed for people using postmark I’d suggest you move this into the suggested dependencies. This will prevent pulling this and the aws sel for people not using it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups my bad ;)
Looks good. Last thing is : can you added it to the changelog (https://github.com/zf-fr/zfr-mail/blob/master/CHANGELOG.md) ? I'll tag this as 2.2.0. |
@bakura10 done 👍 |
Thanks!! |
Add Amazon SES provider