Sorry for my English - if something is unclear, ask me in the comments - I will clarify this.
I am building a system in microservice architecture. I have one service with user information, one service for “suggestions” and one service for “ideas”. Services "offers" and "ideas" in the community (through the Restful API) with the "User" service during registration and other operations. And I wonder - how to deal with email? Each service has a separate interface and sends emails after some actions (for example, when some third party opens a link with an offer, the user who created this offer will receive an email or when some user creates an idea, the manager will receive an email). Moreover, in each service interface, a manager can create a “periodic”a newsletter with season statistics or just some other information. Each service email looks different and has different content.
I have many options and do not know what will be better. Here are some suggestions:
- Each service has a separate email system and sending all types of email (after the action and periodic).
- The “user service” has an “engine” for sending actions, and periodic emails and other services give the task. Inside the task there is a link to the service that gives the task, and this link will generate the contents of the email (for example, statistics of the witch in the periodic email). This decision is difficult ...
- "User service" has only an engine for periodic emails (tasks have a link to generate an email body ...), but an email after actions are sent from each microservice without changes
- ( " " ) API. , , "", ( ) - , , ....
? - ?