小编Bob*_*ers的帖子

Firebase函数环境变量无法读取未定义的属性

我有一个与firebase连接的有角度的应用程序。到目前为止,我已经完成了数据库和身份验证。但是现在,我只能使用云功能。每当有人预订受益人时,我都会尝试通过nodemailer发送电子邮件。该功能代码大部分是从firebase github函数示例中复制的,如下所示:

'use strict';

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.
const gmailEmail = functions.config().gmail.email;
const gmailPassword = functions.config().gmail.password;
const mailTransport = nodemailer.createTransport({
  service: 'gmail',
  auth: {
    user: gmailEmail,
    pass: gmailPassword,
  },
});

// Sends an email confirmation when a user changes his …
Run Code Online (Sandbox Code Playgroud)

firebase google-cloud-functions angular

1
推荐指数
1
解决办法
1321
查看次数

标签 统计

angular ×1

firebase ×1

google-cloud-functions ×1