I'm trying to create a cloud function that will listen for when users are created, and then send an email verification to the user that was created.
I have this code:
export const verifyEmail = functions.auth.user().onCreate((user) => {
});
The problem I have here is that user
gives me no way of accessing sendEmailVerification
. The only way of accessing that function is via the currentUser
, but since this happens in a cloud function reaction to onCreate
there is no current user.
I need to somehow get a firebase.User
instance instead of a firebase.UserRecord
, as the onCreate
gives me.
How can I solve this?