我正在使用QnA服务回答某些问题的机器人中工作。我设置了邮件或Microsoft Teams之类的渠道,以便该漫游器可以在那里答复。我想配置邮件通道,以便在主题是特定主题时做出响应。
在将漫游器链接到邮件通道的位置上,我看不到任何配置选项:
有什么方法可以配置它?
答案 0 :(得分:1)
使用漫游器配置电子邮件通道和使逻辑工作正常是两个不同的事情。
This文档将使您能够将本机元数据传递到活动对象的channel data属性中的信道。
例如,自定义电子邮件的channelData属性的JSON对象如下所示:
"channelData": {
"type": "message",
"locale": "en-Us",
"channelID": "email",
"from": { "id": "mybot@mydomain.com", "name": "My bot"},
"recipient": { "id": "joe@otherdomain.com", "name": "Joe Doe"},
"conversation": { "id": "123123123123", "topic": "awesome chat" },
"channelData":
{
"htmlBody": "<html><body style = /"font-family: Calibri; font-size: 11pt;/" >This is more than awesome.</body></html>",
"subject": "Super awesome message subject",
"importance": "high",
"ccRecipients": "abcdef@xxx.com"
}
}
可以实现在ChannelData中设置电子邮件渠道特定属性的示例,例如:
if (message.ChannelId == ChannelIds.Email)
{
var reply = message.CreateReply();
reply.ChannelData = JObject.FromObject(new
{
htmlBody = "<html><body style=\"font-family: Calibri; font-size: 11pt;\">This is the email body!</body></html>",
subject = "This is the email subject",
importance = "high"
});
//send reply to user
await context.PostAsync(reply);
}
希望这会有所帮助。