I want to display on my chatbot the link.
message: { contentType: 'PlainText', content:"<a href="www.google.com">Test Result</a>" },
html tag displays as it is. How can I display the content as html?
The Lambda Placeholder Create a simple Lambda function that returns an HTML string. Log into to the AWS Console and navigate to the Lambda service. Create a new Lambda function and select the hello-world template.
Open the Functions page of the Lambda console. Choose a function and then choose Versions. On the versions configuration page, choose Publish new version. (Optional) Enter a version description.
On the Code tab, for Code entry type, choose to edit the code in the browser, upload a . zip file, or upload a file from Amazon S3. Choose either Save or Save and test. Choose Actions, and choose Publish new version.
If you are using a Lambda Proxy Integration, you need to use JSON. parse(event. body) for JavaScript or json. loads(event["body"]) for Python.
For those that are using the serverless framework, you can configure the content-type of your function's response in your serverless.yml file, for example:
downloadImage:
handler: lib/client-app-services.downloadImage
events:
- http:
path: client/images/{filename}
method: get
cors: true
integration: lambda
response:
headers:
Content-Type: "'image/jpeg'"
Cache-Control: "'max-age=120'"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With