From the course: Angular: Cloud-Powered Apps with Firebase

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Cloud Functions: Authentication trigger

Cloud Functions: Authentication trigger

From the course: Angular: Cloud-Powered Apps with Firebase

Start my 1-month free trial

Cloud Functions: Authentication trigger

- [Instructor] Let's write our code now for the Firebase function. I have required the Firebase functions here, and I would also require the node mailer, since that will be used to send emails. Const node mailer, require node mailer. Next, I will grab a hold of the environment variables that we have previously set. You can grab the Gmail email, by getting the config, and then the email property. And we will also grab the password config, that we previously set. Next, I need to create a mail transport object. I can do so by calling the create transport method here. The service will be Gmail, and pass in the authentication information. The user, and also, the password. I will then create a variable to hold the app name, and this will simply be The Grid Dashboard. Next, let's create the function for sending the welcome email. This would be a async function. And we'll call this function 'send welcome email.' The…

Contents