I am registering new users in client side and then I read somewhere and also other community members told me that having this function in Cloud will trigger it automatically and send an email after each user has been created:
exports.sendWelcomeEmail = functions.region('europe-west6').auth.user().onCreate((user) => {
user.sendEmailVerification().then(function () {
// Email sent.
}).catch(function (error) {
// An error happened.
});
});
The problem is that (according to the documentation) sendEmailVerification()
does not work in Admin SDK, only in Client SDK. Am I missing something here?