Email Field from Slack to AWS Lamba
{
"messageVersion": "1.0",
"invocationSource": "DialogCodeHook",
"userId": "xxx",
"sessionAttributes": {
"currentReservation": ""
},
"requestAttributes": {
},
"bot": {
"name": "BookTrip",
"alias": "shoping",
"version": "7"
},
"outputDialogMode": "Text",
"currentIntent": {
"name": "Shoping",
"slots": {
"offer": "Yes",
"email_address": null
},
"slotDetails": {
"offer": {
"resolutions": [
{
"value": "Yes"
}
],
"originalValue": "Yes"
},
"email_address": {
"resolutions": ,
"originalValue": null
}
},
"confirmationStatus": "None"
},
"inputTranscript": "<mailto:xxx.20@gmail.com|xxx.20@gmail.com>"
}
When bot asks for email address. User entered xxx.20@gmail.com for the email_address slot.
But when the request comes from the slack, it is not coming in the slot.
Any suggestions or a solution is appreciated.
aws-lambda slack aws-lex
add a comment |
{
"messageVersion": "1.0",
"invocationSource": "DialogCodeHook",
"userId": "xxx",
"sessionAttributes": {
"currentReservation": ""
},
"requestAttributes": {
},
"bot": {
"name": "BookTrip",
"alias": "shoping",
"version": "7"
},
"outputDialogMode": "Text",
"currentIntent": {
"name": "Shoping",
"slots": {
"offer": "Yes",
"email_address": null
},
"slotDetails": {
"offer": {
"resolutions": [
{
"value": "Yes"
}
],
"originalValue": "Yes"
},
"email_address": {
"resolutions": ,
"originalValue": null
}
},
"confirmationStatus": "None"
},
"inputTranscript": "<mailto:xxx.20@gmail.com|xxx.20@gmail.com>"
}
When bot asks for email address. User entered xxx.20@gmail.com for the email_address slot.
But when the request comes from the slack, it is not coming in the slot.
Any suggestions or a solution is appreciated.
aws-lambda slack aws-lex
add a comment |
{
"messageVersion": "1.0",
"invocationSource": "DialogCodeHook",
"userId": "xxx",
"sessionAttributes": {
"currentReservation": ""
},
"requestAttributes": {
},
"bot": {
"name": "BookTrip",
"alias": "shoping",
"version": "7"
},
"outputDialogMode": "Text",
"currentIntent": {
"name": "Shoping",
"slots": {
"offer": "Yes",
"email_address": null
},
"slotDetails": {
"offer": {
"resolutions": [
{
"value": "Yes"
}
],
"originalValue": "Yes"
},
"email_address": {
"resolutions": ,
"originalValue": null
}
},
"confirmationStatus": "None"
},
"inputTranscript": "<mailto:xxx.20@gmail.com|xxx.20@gmail.com>"
}
When bot asks for email address. User entered xxx.20@gmail.com for the email_address slot.
But when the request comes from the slack, it is not coming in the slot.
Any suggestions or a solution is appreciated.
aws-lambda slack aws-lex
{
"messageVersion": "1.0",
"invocationSource": "DialogCodeHook",
"userId": "xxx",
"sessionAttributes": {
"currentReservation": ""
},
"requestAttributes": {
},
"bot": {
"name": "BookTrip",
"alias": "shoping",
"version": "7"
},
"outputDialogMode": "Text",
"currentIntent": {
"name": "Shoping",
"slots": {
"offer": "Yes",
"email_address": null
},
"slotDetails": {
"offer": {
"resolutions": [
{
"value": "Yes"
}
],
"originalValue": "Yes"
},
"email_address": {
"resolutions": ,
"originalValue": null
}
},
"confirmationStatus": "None"
},
"inputTranscript": "<mailto:xxx.20@gmail.com|xxx.20@gmail.com>"
}
When bot asks for email address. User entered xxx.20@gmail.com for the email_address slot.
But when the request comes from the slack, it is not coming in the slot.
Any suggestions or a solution is appreciated.
aws-lambda slack aws-lex
aws-lambda slack aws-lex
asked Nov 12 at 9:52
Ch V Kishore
1338
1338
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Lex is not able to recognize the input as an email because Slack is wrapping the actual input with <mailto:...|...>
. You can see the input that Lex is provided in the inputTranscipt
value of the event.
I'm assuming you have Lex connected directly to Slack, and that you are using a Lambda Function.
In Lambda, you will have to parse the inputTranscript
and fill the slot yourself. You can try something like this (Node.js):
var userInput = event["inputTranscript"];
var email = userInput .split("|");
email = email[1].replace(">","");
console.log(email);
event["currentIntent"]["slots"]["email_address"] = email;
You should only do the above after user inputs their email. It will take the whole input from Slack, including the mailto:
wrapper tag and split that in half as an array. Then it takes the second half and removes the ">" at the end. You should then be left with the pure email, as the user had originally input it. Then set that in the slot. As you pass the slots back to lex in the response, Lex will then recognize the email_address
slot as filled.
You may have to process the inputTranscript
often like this. I have found that keeping track of the last elicited slot in a sessionAttribute
helps me determine where in the conversation I need to parse the input in specific ways.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259585%2femail-field-from-slack-to-aws-lamba%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Lex is not able to recognize the input as an email because Slack is wrapping the actual input with <mailto:...|...>
. You can see the input that Lex is provided in the inputTranscipt
value of the event.
I'm assuming you have Lex connected directly to Slack, and that you are using a Lambda Function.
In Lambda, you will have to parse the inputTranscript
and fill the slot yourself. You can try something like this (Node.js):
var userInput = event["inputTranscript"];
var email = userInput .split("|");
email = email[1].replace(">","");
console.log(email);
event["currentIntent"]["slots"]["email_address"] = email;
You should only do the above after user inputs their email. It will take the whole input from Slack, including the mailto:
wrapper tag and split that in half as an array. Then it takes the second half and removes the ">" at the end. You should then be left with the pure email, as the user had originally input it. Then set that in the slot. As you pass the slots back to lex in the response, Lex will then recognize the email_address
slot as filled.
You may have to process the inputTranscript
often like this. I have found that keeping track of the last elicited slot in a sessionAttribute
helps me determine where in the conversation I need to parse the input in specific ways.
add a comment |
Lex is not able to recognize the input as an email because Slack is wrapping the actual input with <mailto:...|...>
. You can see the input that Lex is provided in the inputTranscipt
value of the event.
I'm assuming you have Lex connected directly to Slack, and that you are using a Lambda Function.
In Lambda, you will have to parse the inputTranscript
and fill the slot yourself. You can try something like this (Node.js):
var userInput = event["inputTranscript"];
var email = userInput .split("|");
email = email[1].replace(">","");
console.log(email);
event["currentIntent"]["slots"]["email_address"] = email;
You should only do the above after user inputs their email. It will take the whole input from Slack, including the mailto:
wrapper tag and split that in half as an array. Then it takes the second half and removes the ">" at the end. You should then be left with the pure email, as the user had originally input it. Then set that in the slot. As you pass the slots back to lex in the response, Lex will then recognize the email_address
slot as filled.
You may have to process the inputTranscript
often like this. I have found that keeping track of the last elicited slot in a sessionAttribute
helps me determine where in the conversation I need to parse the input in specific ways.
add a comment |
Lex is not able to recognize the input as an email because Slack is wrapping the actual input with <mailto:...|...>
. You can see the input that Lex is provided in the inputTranscipt
value of the event.
I'm assuming you have Lex connected directly to Slack, and that you are using a Lambda Function.
In Lambda, you will have to parse the inputTranscript
and fill the slot yourself. You can try something like this (Node.js):
var userInput = event["inputTranscript"];
var email = userInput .split("|");
email = email[1].replace(">","");
console.log(email);
event["currentIntent"]["slots"]["email_address"] = email;
You should only do the above after user inputs their email. It will take the whole input from Slack, including the mailto:
wrapper tag and split that in half as an array. Then it takes the second half and removes the ">" at the end. You should then be left with the pure email, as the user had originally input it. Then set that in the slot. As you pass the slots back to lex in the response, Lex will then recognize the email_address
slot as filled.
You may have to process the inputTranscript
often like this. I have found that keeping track of the last elicited slot in a sessionAttribute
helps me determine where in the conversation I need to parse the input in specific ways.
Lex is not able to recognize the input as an email because Slack is wrapping the actual input with <mailto:...|...>
. You can see the input that Lex is provided in the inputTranscipt
value of the event.
I'm assuming you have Lex connected directly to Slack, and that you are using a Lambda Function.
In Lambda, you will have to parse the inputTranscript
and fill the slot yourself. You can try something like this (Node.js):
var userInput = event["inputTranscript"];
var email = userInput .split("|");
email = email[1].replace(">","");
console.log(email);
event["currentIntent"]["slots"]["email_address"] = email;
You should only do the above after user inputs their email. It will take the whole input from Slack, including the mailto:
wrapper tag and split that in half as an array. Then it takes the second half and removes the ">" at the end. You should then be left with the pure email, as the user had originally input it. Then set that in the slot. As you pass the slots back to lex in the response, Lex will then recognize the email_address
slot as filled.
You may have to process the inputTranscript
often like this. I have found that keeping track of the last elicited slot in a sessionAttribute
helps me determine where in the conversation I need to parse the input in specific ways.
answered Nov 13 at 3:57
Jay A. Little
1,3351418
1,3351418
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53259585%2femail-field-from-slack-to-aws-lamba%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown