相关疑难解决方法(0)

使用有角度的2应用程序从Cloud Functions for Firebase发送邮件电子邮件

我正在尝试使用来自firebase云功能的Mailgun的api发送电子邮件.我已经尝试在Cloud Function中实现了相同的nodejs教程,但我总是得到"错误:无法处理请求".请问我做错了什么.

云功能代码如下:

 <pre>
  <code>
 var functions = require('firebase-functions');

 var nodemailer = require('nodemailer');

  var auth = {
  auth: {
      api_key: '###################',
       domain: 's###############g'
   }
 }
 exports.helloWorld = functions.https.onRequest((request, response) => {
  response.send("Hello from Firebase!");
  });

   var nodemailerMailgun = nodemailer.createTransport(auth);

 exports.sendEmail = functions.https.onRequest((request, response) =>{
  //app.get('/', function(req, res) {
   test();
 });

  function test(){
     const mailOptions = {
        //Specify email data
            from: "info@xyz.com",
            //The email to contact
        to: "xyz@yahoo.com",
        //Subject and text data  
        subject: 'Hello from Mailgun',
        text: 'Hello, This is not …
Run Code Online (Sandbox Code Playgroud)

node.js firebase mailgun google-cloud-functions angular

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