Send adaptive card in email through AWS email service (SES) - node.js

I have a nodejs application by which I am trying to figure out if we can send adaptive cards in email using a third party layer like Amazon SES. As per microsoft documentation the adaptive card data needs to be in header under script tags.
https://learn.microsoft.com/en-us/outlook/actionable-messages/send-via-email
I am receiving the emails but the card is not visible in the email, the text apart of adaptive card is visible. But when I go to View source of the email I do see the adaptive card content in the raw email data.
Email data -
<script = type=3D"application/adaptivecard+json"> { "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.0", "originator": "", "body": [ { "size": "large", "text": "Hello Actionable message", "wrap": true, "type": "TextBlock" } ], "actions": [ { "type": "Action.InvokeAddInCommand", "title": "Open Actionable Messages Debugger", "addInId": "3d1408f6-afb3-4baf-aacd-55cd867bb0fa", "desktopCommandId": "amDebuggerOpenPaneButton" } ] } </script>If the card doesn't appear, install Actionable Me= ssages Debugger Outlook add-in to debug the issue.
I tried sending adaptive card using https://amdesigner.azurewebsites.net/ which works as expected.
Not sure if using a third party layer for sending adaptive card requires any additional setting.

Related

Is it possible to configure Improved JSON SIM for a specific envelope?

Improved JSON SIM format seems to be something fairly new and from reading the documentation it seems that, through the API, we can only create an account level configuration, meaning that we will receive events from all envelopes and only admins can create this configurations.
Is it possible to configure the webhooks for specific envelopes with non-admin users, the same way we can do it with the aggregate webhooks?
Are you planning to deprecate the other webhook models?
The new JSON SIM format can be set for the per-envelope webhooks. Below is a code snippet with the deliveryMode, the Events, and the format that will need to be set in the eventNotification section to enable this new format. One thing to note is this new format has a new webhook structure so would recommend testing in Demo first.
In terms of deprecating other methods we will not be deprecating XML/JSON aggregate modes for the foreseeable future but we will be launching a deprecation plan for XML SIM later this year. More details to come on that.
{
"emailSubject": "Please sign the attached document",
"status": "sent",
"eventNotification": {
"url": "https://apps.example.com/app2/webhook-listener",
"requireAcknowledgment": "true",
"loggingEnabled": "true",
"deliveryMode": "SIM",
"events": ["envelope-sent", "envelope-resent", "envelope-delivered", "envelope-completed", "envelope-declined", "envelope-voided", "envelope-signed", "recipient-authenticationfailed", "recipient-autoresponded", "recipient-declined", "recipient-deliveryfailed", "recipient-delivered", "recipient-completed", "recipient-sent", "recipient-resent"],
"eventData": {
"version": "restv2.1",
"format": "json",
"includeData": ["custom_fields", "extensions", "folders",
"recipients", "powerform", "tabs", "payment_tabs"]
}
},
"recipients": {
"signers": [
…

How To Create A Hyperlink For My Dialogflow Chatbot In Responses

I created a chatbot using dialogflow and I added a website link to the response, I have integrated the bot in Telegram and the website link is working perfectly, but on the web demo, it is not. Is it possible that when I integrate the chatbot on a website using Kommunicate, the hyperlink will work?
Kommunicate has a link button template, create a Dialogflow intent using below metadata.
{
"message": "click on the buttons",
"platform":"kommunicate",
"metadata": {
"contentType": "300",
"templateId": "3",
"payload": [{
"type": "link",
"url": "https://www.google.com",
"name": "Go To Google"
},
{
"type": "link",
"url": "https://www.facebook.com",
"name": "Go To Facebook",
"openLinkInNewTab": false
}
]
}
}
The openLinkInNewTab: false to open any link in the same tab. Default value is true, which will open the links in the new tab.
Here is more information about the same.
Also, you can render HTML content as a message and Kommunicate will render the HTML in the UI. Here is the metadata for that.
Sadly the web demo only supports plain text responses, so adding an clickable url within your chatbot for the webdemo isn't possible. Luckily, this is a limitation for web demo, so any other integration that do support URL's in their chats will work as you have seen with Telegram.

how to open url in other browser using adaptive card in microsoft teams bot?

I am using microsoft teams bot framework and I want a adaptive card with a button to open url in popout(other browser)
By using (Actions.openUrl) it Opens a URL in the default browser.
and want it to open in other browser
This is what i have tried and I am using node.js
var card = {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [{
"type": "Container",
"items": [{
"type": "TextBlock",
"text": `${session.message.text}`,
"weight": "bolder",
"size": "medium"
}
]
},
{
"type": "Image",
"url": `${bodyData.img}`
},
{
"type": "Container",
"items": [{
"type": "TextBlock",
"text": `${bodyData.calendar}`,
"wrap": true
}]
}
],
"actions": [
{
"type": "Action.openUrl",
"title": "Open in Popout",
"url": `${bodyData.url}`
}
]};
Like paul cheung said, you cannot specify the browser in an openUrl button. Not only that, you cannot specify the URL's "target" in an openUrl button. You can see here that the only thing you can specify is the URL itself. The details of how the URL gets opened are the responsibility of the client and the bot has no control over them.
I think you have a few options.
Option 1
If you really want to open a browser window like a popup, you can try creating a sort of redirect page that the card would link to. When the user clicks the button, your redirect page would open in a new tab of the current browser window and then whatever client-side code you've set up would open the target page in a new window and close the redirect page's tab.
Option 2
The conventional way to do what you're talking about in Teams is to use a task module. Depending on what your URL contains, you might even consider putting a card in your task module instead of a web page.
This action type specifies a URL to launch in the default browser, You can NOT specify the browser at moment. BTW, the default browser is a system level setting(default program) as you know.
Update:
like Kyle said, if task module is your option, Here is a repository you can take a quick look, it includes all necessary code. popout window was triggered in javascript and adaptive card.

How to do downloadable file in response from the bot

Hello there :)
Challenge Skype; Bot Framework; receive downloadable files
I have an issue. My project is to ask something to the bot (using Bot Framework Emulator currently but later I will use Skype) and the bot answers with an attached image/chart.
I can display through the interface the answer and the image. However, the user cannot download this image.
How can I do that ?
There is an option in an AdaptiveCard message to be able to download the attached image thanks to a Button ?
I tried with HeroCard, ThumbnailCard, AdaptiveCard and a simple attachment but it did not solve my problem.
Thanks in advance :)
There's a couple of different ways you can go about this.
Using Cards
First, cards don't allow you to directly download an attachment. At best, they can link you to the image (or other file) you want your user to download. Example json for an Adaptive Card that can do this:
{
"type": "AdaptiveCard",
"body": [
{
"type": "Image",
"selectAction": {
"type": "Action.OpenUrl",
"url": "https://dev.botframework.com/Client/Images/ChatBot-BotFramework.png"
},
"url": "https://dev.botframework.com/Client/Images/ChatBot-BotFramework.png"
},
{
"type": "TextBlock",
"text": "This card's action will open an image"
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "Open Image",
"url": "https://dev.botframework.com/Client/Images/ChatBot-BotFramework.png"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
And looks like this:
This card displays an image and includes a link for a user to open and download it. Because I added an Action.OpenUrl directly to the image, the user can click the image to open and then download it--the "Open Image" button is just to show another method.
Here's a great website for Adaptive Card Documentation, Schema, and a user-friendly Designer. Note that the Designer doesn't allow you to easily add Actions at this time. You have to manually add them in the JSON portion.
Sending Attachments
You can, however, directly send a message that includes the ability to download files.
You can define an attachment with:
const attachment = {
name: 'PDF',
contentType: 'application/pdf',
contentUrl: 'https://media.readthedocs.org/pdf/microsoftbotframework/latest/microsoftbotframework.pdf',
}
And then send it to the user with:
await step.context.sendActivity({
text: 'Attachment',
attachments: [attachment],
});
Two important notes:
This method works well for sending files. If you use an image, it will display an unclickable image. This means Adaptive Cards would be better for sending downloadable images.
Your code might use something other than step.context. This is for sending it as part of a Waterfall Dialog. You may need some other version of context.sendActivity for your bot.
If you found this answered your question, please mark it as "Answered" and I can clear it off of my support ticket tracker. Otherwise, feel free to comment and I can help you further.

fallback intent not invoked from Carousel (Actions on Google)

I am connecting Actions on Google (on my Android) to my webhook via API.AI
When a user orders, say pizza online, API.AI creates a fallback intent and the webhook sends a json with Carousel.
This works fine. If user clicks on Carousel item, the response is sent to webhook too.
I am responding to that click by asking "How many pizzas" and use a suggestion chip.
However, no fallback intent is activated in API.AI and the app crashes.
Earlier, I was giving a simple text response to carousel select "Thanks for the order" and it was working.
Can someone help me solve this problem?
I realize that the problem is not in API.AI or fallback intent but in JSON I am sending. If I reply to user's selection in Carousel with a simple text/speech response it works. It also works if I send a Carousel chip again. However, if I try to send a list or card, it crashes. Perhaps, I don't have right json formatting for them.
If someone has any json sent by their webhook (working with API.AI) for list/suggestion chip or card, it would be very helpful!
#matthewayne When I send the following as a reply (json), it works:
speech = "Thank you. People also looked at these:"
print(speech)
webhook_result={
"speech": speech,
"contextOut": [
{
"name": "_actions_on_google_,complementary",
"lifespan": 100,
"parameters": {}
}
],
"data": {
"google": {
"expectUserResponse": True,
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": speech
}
}
],
"suggestions": []
},
"systemIntent": {
"intent": "actions.intent.OPTION",
"data": {
"#type": "type.googleapis.com/google.actions.v2.OptionValueSpec",
"carouselSelect": {}
}
}
}
}
}
I also populate carouselSelect with list of things in carousel. But if I change it to listSelect, and respond, it crashes.
When I say crash, it means that Google says that my app has stopped responding.
It would be very helpful to have a template or sample listResponse json.
After a carousel response is sent to the user the next request that will be sent will likely be a list selection event. You need to handle this either:
in API.AI (by creating an intent with the event actions_intent_OPTION, docs here)
or
in your webhook using the Google Assistant client library (docs here).

Resources