AWS SES works with Lex Test Chatbot but after the chatbot is published with Slack app it does not work( doesn't trigger email service). However there does not seem to be any problem with Lambda function as I am getting the response text back in slack. And i don't think there is a way to check the error why slack is making the problem.
Lambda Function:
var aws = require('aws-sdk');
var ses = new aws.SES({
region: 'us-east-1'
});
exports.handler = function(event, context, callback) {
var eParams = {
Destination: {
ToAddresses: [event.currentIntent.slots.Email]
},
Message: {
Body: {
Text: {
Data: "Hi, How are you?"
}
},
Subject: {
Data: "Title"
}
},
Source: "abc@gmail.com"
};
var email = ses.sendEmail(eParams, function(err, data) {
if (err)
else {
context.succeed(event);
}
});
callback(null, {
"dialogAction": {
"type": "ConfirmIntent",
"fulfillmentState": "Fulfilled",
"message": {
"contentType": "PlainText",
"content": "message to convey to the user, i.e. Are you sure you want a large pizza?"
}
}
});
};
Edit 1: I figured the issue is that i am not getting the values in [event.currentIntent.slots.Email] when i publish my Lex bot on Slack.