firebase Cloud Functions for Firebase Send welcome notification emails to the users for subscribing.


Use the GitHub repository to get the entire code:

  • Copy or clone the repository in your computer.

Now go to your Firebase Console

  • Create a Firebase Project using the Firebase Console.
  • Enable the Google Provider in the Auth section.
  • Paste the Web initialization snippet from: Firebase Console > Overview > Add Firebase to your web app in the public/index.html where the TODO is located.
 * TODO(DEVELOPER): Paste the initialization snippet from: Firebase Console > Overview > Add Firebase to your web app. *
 *********************************************************************************************************************** -->
 <script src=""></script>
   // Initialize Firebase
   var config = {
     apiKey: "your apiKey",
     authDomain: "",
     databaseURL: "",
     storageBucket: "",
     messagingSenderId: "messagingID"

Install Firebase CLI in your computer

  • If you don't have NodeJS installed already, install it from (Make sure to have the updated version of NodeJS installed on your computer.)
  • Open command prompt/terminal and install it with npm install -g firebase-tools and then configure it with firebase login
  • To choose your project you created now ==> Configure the CLI locally by using firebase use --add and select your project in the list.
  • Install dependencies locally by running: cd functions; npm install; cd -

Set Google Cloud environment variables

  • Set the and gmail.password Google Cloud environment variables to match the email and password of the Gmail account used to send emails. For this open the command prompt or terminal and type the following Firebase CLI command:

    firebase functions:config:set"" gmail.password="secretpassword"

Deploy the project and test

  • To deploy the project open the cmd/terminal and use the command firebase deploy to start the deployment.

successfull deployment snapshot

  • Once it gets done, use the command to open the site in browser firebase open hosting:site or manually do it from the url displayed.