I'm building an add on that users have to subscribe to, yet because of privacy, user details like email addresses aren't accessible.
I have used Properties Service to try to get users email addresses. It works only for me, but not for others. This is a problem because there's no way I can verify who is a premium user and who is a normal user. My main challenge is in understanding how other addon deevlopers have succeeded in achieving this
var userEmail = Session.getActiveUser().getEmail();
var userProperties = PropertiesService.getUserProperties();
userProperties.setProperty("email", userEmail);
var email = userProperties.getProperty("email")
Logger.log(email) // Nothing is logged to the console or writing email to DB fails
I expect to have access to users email, write those emails to my database, but I get an empty string
How do I achieve this status for my addon. I would prefer a detailed solution. Thanks in advance