I have a web application that should send emails to admin users when something happens in the application. For instance, a new user is registered.
I would like to avoid having the logic of building/sending the emails inside of the application. I would rather prefer that the application publishes a message in a queue, and then, there is another system listening and reacting properly to send the emails.
The flow would be something like that.
- The application publishes a message in a queue (SQS or SNS??)
- A lambda function is trigger. Lambda reads the message and calls SES.
- SES sends the email
I'm not sure if that is the best way of doing this. I have read that there is a gap between SQS and Lambda. Would it be better with SNS?
What would be the proper flow?
App -> SQS -> Lambda -> SES
or
App -> SNS -> Lambda -> SES
Maybe something else?
Please, take into consideration that the idea is always to abstract the web application from all that logic. The web application would only publish a message somewhere. Then the magic happens in the background.