Email notification for App users?

Hey all, I’m working on an App where some level of email notification is needed. E.g. when a user (with Blockstack Auth, obviously) has created content in the App, there are moments that a email has to be sent to the creator, for example when an other user interacted with it.

I prefer not to store email addresses in the App backend, but I’m uncertain about the possibility to contact the user by email when only the Blockstack ID is known.

What would be the “royal route” to notify App users by email?

You should be able to get the email in the UserData for the current session via the loadUserData function:

https://blockstack.github.io/blockstack.js/interfaces/userdata.html

Thank @moxiegirl

for the current session

Does that mean it can only be retrieved at the moment a Blockstack user interacts (logs in or posts for example) with the app? Meaning, if I want to be able to notify that user e.g. a month later, I cannot fetch it just then?

Please note that basically I’m not interested to know a users email address for all thinkable reasons of privacy, security, etc. Though I understand it’s probably not a core functionality of Blockstack, but it would be awesome if there’s an API to send notifications through Blockstack for users that are using an app.

Lastly, email seems to be optional so to be able to send notifications I probably need to users to submit their email in our app anyway? :thinking:

Yes, unfortunately there’s not a good solution besides asking the app user for the email.

You’re right, the auth api might not return an email if the user doesn’t provide it.

Would love to see a solution to this notification problem.

1 Like

The most promising proposal is this Proposal: Gaia Hub Inboxes

I am sure they are happy to accept pull requests :slight_smile:

Looks great indeed, but no viable option for me for now. So we’ll need to store email addresses ourselves then …