opencommunitymap / communitymap-cloud-functions

API and microservices of Open Community Map
https://communitymap.online/
Apache License 2.0
1 stars 2 forks source link

Send email for new direct message #5

Open dmitry-yudakov opened 4 years ago

dmitry-yudakov commented 4 years ago

If the user is registered with verified email, it'd be nice to send to notify him when someone writes to him.

It could probably be done with a cloud function with firestore trigger.

It's a bit more complicated - we shouldn't email after every direct message as it's like chat thus encouraging sending more than one message - instead it'd be better to notify (1) about a new group of messages and (2) after they're not read for some time or if we detect user is not online.

We can't detect whether or not the user is online yet. If he's online and new message is sent, unread-message indicator appears on his profile icon.