'Watson Assistant bot not extracting parameters to be send to my cloud function
Hi so I have almost everything to make my Watson Assistant chatbot work, the only feature that is missing is send emails with user input. I made a cloud function that currently takes the parameters of email and reminder.
I am using webhooks on my chatbot for that specific skill, however when I tested it to send a reminder it doesn't take the params.reminder that I am giving it. If I test it inside the cloud function it works because I am inputting the parameters, but I don't know why is not taking it when I give it to the bot
var nodemailer = require('nodemailer');
let smtpConfig = {
host: 'smtp.gmail.com', // you can also use smtp.gmail.com
port: 465,
secure: true, // use TLS
auth: {
user: 'myuser',
pass: 'mypassword'
}
};
function main(params) {
sendEmail(params, function (email_response) {
});
}
function sendEmail(params, callback) {
let transporter = nodemailer.createTransport(smtpConfig);
let mailOptions = {
from: `Watson Assistant Emails <${smtpConfig.auth.user}>`,
to: params.email,
subject: `REMINDER: ${params.reminder}`
};
transporter.sendMail(mailOptions, function (error, info) {
let email_response = {
code: 200,
msg: 'Email was sent successfully',
reason: 'Success'
};
return email_response;
});
}
I am also attaching images of what my current bot is like and where I have my webhooks Thank you in advance again! Part 1 of chatbot Next dialog Webhook call
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
