-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
AWS SES #60
base: master
Are you sure you want to change the base?
AWS SES #60
Conversation
vnandwana
commented
Apr 23, 2024
- Added support for sending emails using AWS SES.
- Updated the README.
* Updated the README.
|
||
## AWS SES | ||
|
||
Refer to the [plugin configuration](https://docs.killbill.io/latest/email-notification-plugin#plugin_configuration) section for instructions on setting up 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.
See my comment here
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.
Kindly check my reply on that PR.
@@ -214,12 +220,16 @@ private void sendEmailViaSMTP(final List<String> to, final List<String> cc, fina | |||
private void sendEmailViaSES(final List<String> to, final List<String> cc, final String subject, | |||
final String body, final SmtpProperties smtp) { | |||
|
|||
logger.info("Setting up 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.
Should this be debug
?
return; | ||
} | ||
|
||
final Regions region = Regions.valueOf(awsRegion.replace("-", "_").toUpperCase()); | ||
|
||
logger.info("Creating AWS SES client..."); |
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.
Should this be debug
?
|
||
logger.info("Sending email to={}, cc={}, subject={}", to, cc, subject); | ||
|
||
client.sendEmail(request); | ||
|
||
logger.info("Email sent successfully"); |
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.
- Instead of printing 2 traces, one before and one after - is there a status we could use (or exception handling) from
client.sendEmail()
? - Also, the traces are not consistent - if we print
to
,cc
... in the first one, we should do the same in the second one. But based on point 1/ I think we could do with one trace.
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.
The sendEmail function returns a SendEmailResult object with only a messageId
property. If this property has a value, it means the email was successfully sent. If not, an exception is thrown, which helps identify any configuration problems. I've made the logging consistent for now. Let me know if you need further adjustments. Thank you.
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.
@sbrossie, kindly take a look at this when you get a chance. I don't think we should handle the exception here, as the exception stack trace helps in identifying any configuration issues in the environment.