Sorry about my english - if some thing is not clear please ask me in comments - i will clarify this.
I build system in microservice architecture. I have one service with user information, one service for "offers", and one service for "ideas". Services "offers" and "ideas" comunicate (by Restful API) with "User" service on login and other operations. And i wonder - how to deal with emails? Each service have it separate frontend and send emails after some actions (eg. when some third person open link with some offer the user who create this offer will get email, or when some user create idea the manager will get email). Moreover, on each service frontend, manager can create "periodic" mailing with season statistical data or just some other information. Each service email looks differently and have different content.
I have many choices and don't know which will be better. This are some propositions:
Which one will be better? Or may be there is some better alternative?
Sending emails it's like making request to another service (via SMTP). So, that's a good approach when every service will be able to send emails.
But, of course there's some common logic for sending emails like rendering templates, sending code, configurations and so on. This logic should be shared between services via common code (dll, package and so on).
So, in this way:
One drawback of this approach is that every service should have the same email configuration (SMTP address, login, password and so on). But if you share configurations between all services it's not a problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With