Welcoming users upon account creation
Welcoming our users when they create their account is something we would have definitely wanted to do before. But, due to lack of support, it was not possible. Now that we have this facility provided by Firebase, it allows us to have an extra custom backend to welcome users to account creation. In this recipe, we're going to see how we can make that happen!
Getting ready
Before you start adding your function's implementation, please make sure that your project is ready for Cloud Functions.
How to do it...
- The new version of Firebase is more event-ready than before. This means that now, whenever we create a new account, we are going to have an event. Bear in mind that this functionality needs the super admin authorization that you won't find anywhere besides Cloud Functions and the Admin SDK API.
- This is how we listen to the account creation event:
exports.sendEmailUponAccountCreation = functions.auth.user().onCreate(ev => { ...