How to make spring boot app to send email with support to configure any email service like mailchimp, sendgrid,

466 views Asked by At

I have implemented a spring boot app to send email using JavaMail API with pre-defined SMTP values. Now, I want to change this to a global configuration. So, that a person using any email service like MailChimp, SendGrid,... can configure their properties and send emails using that.

I'm not sure how to achieve this. Anyone pls let me know?

1

There are 1 answers

0
BenjaminD On

Instead of using configuration files, you can store the needed elements in a database and then customize it for each user.

Before sending an email, you retrieve the SMTP value filled for the current user and use it.