在AdaptiveCard中,使用Action.OpenUrl,拥有mailto链接的邮件操作不再支持。为了解决这个问题,可以使用Action.Submit和microsoftTeams.openUrl,以便启动邮件应用程序并打开一个预先填好的电子邮件。
示例代码:
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"text": "请填写以下表格并点击下面的按钮提交表格。"
},
{
"type": "Input.Text",
"id": "name",
"placeholder": "请输入您的名称"
},
{
"type": "Input.Text",
"id": "email",
"placeholder": "请输入您的电子邮件"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "提交表格"
}
]
}
],
"actions": [
{
"type": "microsoftTeams.openUrl",
"title": "发送邮件",
"url": "mailto:example@example.com?subject=TestSubject&body=MaillContent"
}
]
}