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

Feature/aws ses #3

Merged
merged 14 commits into from
Oct 16, 2017
Merged

Feature/aws ses #3

merged 14 commits into from
Oct 16, 2017

Conversation

Orkin
Copy link
Member

@Orkin Orkin commented Oct 14, 2017

Add Amazon SES provider

@Orkin
Copy link
Member Author

Orkin commented Oct 14, 2017

@danizord @bakura10 @Ocramius

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"
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing that?

Copy link
Member Author

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

Copy link
Member

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' => [
Copy link
Member

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? :)

Copy link
Member Author

@Orkin Orkin Oct 14, 2017

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.

Copy link
Member

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 :)

Copy link
Member Author

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

@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);
Copy link
Member

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.

*/
class AwsSesMailer implements MailerInterface
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove useless empty line.

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"
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups my bad ;)

@bakura10
Copy link
Member

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.

@Orkin
Copy link
Member Author

Orkin commented Oct 16, 2017

@bakura10 done 👍

@bakura10 bakura10 merged commit 5b0a88f into zf-fr:master Oct 16, 2017
@bakura10
Copy link
Member

Thanks!!

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 this pull request may close these issues.

2 participants