Each of the emails that the service has to send, should be stored in a message queue, for reliable sending. The queue should store the already formatted emails with all the necessary information for sending it. A separate message sender service should send the emails from the queue. If there was any error with sending the email, it should push back the email to the queue.
Reliable Message sending
Use a message queue for sending messages
Technical requirements
Each of the emails that the service has to send, should be stored in a message queue, for reliable sending. The queue should store the already formatted emails with all the necessary information for sending it. A separate message sender service should send the emails from the queue. If there was any error with sending the email, it should push back the email to the queue.