Skip to content

AWS SES#60

Merged
sbrossie merged 3 commits intokillbill:masterfrom
vnandwana:master
Jan 16, 2025
Merged

AWS SES#60
sbrossie merged 3 commits intokillbill:masterfrom
vnandwana:master

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. No newline at end of file
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.

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 ?


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 ?


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.

@vnandwana vnandwana requested a review from sbrossie January 12, 2025 18:25
@sbrossie sbrossie merged commit 4bbc976 into killbill:master Jan 16, 2025
11 of 18 checks passed
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