Tag: firebase api.ai

通过Firebase项目上的节点发送电子邮件

我正在研究一个我已经写在node上的google动作,并且正在部署到firebase,通过在API.AI上定义的intent进行交互。 我想实现一个function,当一个特定的意图被激活时,发送一个电子邮件到一个特定的地址。 我试过使用nodemail和sendmail软件包,但是在部署完它们之后,当正确的意图被调用时,他们似乎不会发送电子邮件。 我不确定是否问题在于我编写了错误(鉴于我的经验不足),或者在Firebase部署中指定这些软件包时存在一些固有的问题。 我已经能够通过简单地从API中返回对API.AI的响应来validation我正在执行sendmail的代码; 如果我能够访问firebase或API.AI日志,我不知道如何。 API.AI显示了一个JSON响应,但就这一点而言,据我所知。 这里有一些简化的代码(只有相关的部分): const sendmail = require('sendmail')(); const getSuggestion = app => { const rawInput = app.getRawInput(); sendmail({ from: 'no-reply@yourdomain.com', to: 'myemail@gmail.com', subject: 'test sendmail', html: rawInput, }, function(err, reply) { console.log(err && err.stack); console.dir(reply); return app.ask('You said ' + rawInput + '. Do you have any further input?'); }); […]