code-corps / code-corps-api

Elixir/Phoenix API for Code Corps.
https://www.codecorps.org
MIT License
234 stars 86 forks source link

Send email to user if message has not been read for 3 minutes. #1283

Open begedin opened 6 years ago

begedin commented 6 years ago

Problem

From https://github.com/code-corps/code-corps-api/issues/1234#issuecomment-349187243

The idea behind the messaging feature is that it ought to work mostly in realtime, while still supporting async communication.

In order to achieve that, we need to be able to send an email to the user if the message sent to them has not been marked as read after 3 minutes.

joshsmith commented 6 years ago

What needs clarification here?

joshsmith commented 6 years ago

Possibly the best way to do this is check and see whether an email was sent every so often by looping through unread messages in Quantum every minute.

snewcomer commented 6 years ago

I saw this article recently: https://medium.com/@efexen/periodic-tasks-with-elixir-5d9050bcbdb3?utm_content=buffer2ea59&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer

joshsmith commented 6 years ago

@snewcomer we've used this to great success in other projects https://github.com/c-rack/quantum-elixir