Cloud Functions for Firebase Error parsing your function triggers

I tried to send emails to Firebase users using Cloud Functions for Firebase. I mean the storage of the firebase function at https://github.com/firebase/functions-samples/tree/master/quickstarts/email-users

I install all node packages for the firebase email function as needed and is explained in the repository. I edited TODO in index.js file in function as

const functions = require('firebase-functions'); const nodemailer = require('nodemailer'); // Configure the email transport using the default SMTP transport and a GMail account. // For other types of transports such as Sendgrid see https://nodemailer.com/transports/ // TODO: Configure the `gmail.email` and `gmail.password` Google Cloud environment variables. firebase functions:config:set gmail.email=" email@gmail.com " gmail.password="gmailPassword" const gmailEmail = encodeURIComponent(functions.config().gmail.email); const gmailPassword = encodeURIComponent(functions.config().gmail.password); const mailTransport = nodemailer.createTransport( `smtps://${gmailEmail}:${gmailPassword}@smtp.gmail.com`); 

When I try to deploy a function using the command

 firebase deploy 

This shows me the following error enter image description here

An error occurred while analyzing function triggers.

Can anyone help me in resolving this issue.

+5
source share
1 answer

functions:config is a command that you run from the Firebase CLI from the command line, not from your function code.

So, on the command line / terminal:

 firebase functions:config:set gmail.email=" email@gmail.com " gmail.password="gmailPassword" 
+4
source

Source: https://habr.com/ru/post/1265929/


All Articles