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

AWS SES #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

AWS SES #60

wants to merge 2 commits into from

Conversation

vnandwana
Copy link
Contributor

  • Added support for sending emails using AWS SES.
  • 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.
Copy link
Member

Choose a reason for hiding this comment

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

See my comment here

Copy link
Contributor Author

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

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

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

Choose a reason for hiding this comment

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

  1. Instead of printing 2 traces, one before and one after - is there a status we could use (or exception handling) from client.sendEmail() ?
  2. 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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

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.

None yet

2 participants