[英]How to configure the mail channel of a QnA Bot?
我正在使用 QnA 服务回答一些问题的机器人。 我设置了邮件或 Microsoft Teams 等渠道,以便机器人可以在那里回复答案。 我想配置邮件通道,以便在主题是特定主题时做出响应。
在将机器人链接到邮件频道的位置,我看不到任何配置它的选项:
有没有办法配置它?
Email 与机器人的通道配置和使您的逻辑工作是两件不同的事情。
本文档将使您能够将本机元数据传递到活动对象的通道数据属性中的通道。
例如,自定义 email 消息的 channelData 属性的 JSON object 如下所示:
"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 中设置 Email 通道特定属性的示例,例如:
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);
}
希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.