aws-samples / aws-lex-web-ui

Sample Amazon Lex chat bot web interface
Other
734 stars 466 forks source link

html responses question #99

Closed plagelpuss closed 6 years ago

plagelpuss commented 6 years ago

I do not understand how to have my lex bot return html. I set ui.AllowSuperDangerousHTMLInMessage to true and i added the following to my lambda function let appContext = { altMessages: { html: "<h1>hello!</h1>" } }; outputSessionAttributes.appContext = JSON.stringify(appContext);

I thought that doing that would replace the message with the altMesssage, what am i missing?

plagelpuss commented 6 years ago

nevermind, turns out I wasn't setting ui.AllowSuperDangerousHTMLInMessage to true :(

sumeet-kumar-deloitte commented 4 years ago

Hey man, I know this has been closed for sometime, but can I ask you for a larger snippet of the code where you passed "html" code within a response from lambda. I wish to do the same for creating masked hyperlinks within my bot responses.

An example response :

return { 'sessionAttributes': output_session_attributes, 'dialogAction': { 'type': 'ElicitSlot', 'intentName': intent_request['currentIntent']['name'], 'slots': slots, 'slotToElicit': 'hhIncome', 'message': { 'contentType': 'PlainText', 'content': 'please visit here for more.' } } }

plagelpuss commented 4 years ago

Hey man, I know this has been closed for sometime, but can I ask you for a larger snippet of the code where you passed "html" code within a response from lambda. I wish to do the same for creating masked hyperlinks within my bot responses.

An example response :

return { 'sessionAttributes': output_session_attributes, 'dialogAction': { 'type': 'ElicitSlot', 'intentName': intent_request['currentIntent']['name'], 'slots': slots, 'slotToElicit': 'hhIncome', 'message': { 'contentType': 'PlainText', 'content': 'please visit here for more.' } } }

Hey Sumeet, I do not have access to any of the code I was working on when I posted this. Here is another post that might help though. https://github.com/aws-samples/aws-lex-web-ui/issues/170 good luck, and have a nice day.

sumeet-kumar-deloitte commented 4 years ago

You truly are a god send. I sincerely thank you for directing me towards exactly what I was looking for. Have a good day.