GMail Google Apps脚本插件“从Apps脚本返回的值具有附加平台无法使用的类型". [英] GMail Google Apps Script Plugin "The value returned from Apps Script has a type that cannot be used by the add-ons platform"

查看:56
本文介绍了GMail Google Apps脚本插件“从Apps脚本返回的值具有附加平台无法使用的类型".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在过去的24小时内,我运行的 以前正常工作的 GMail插件开始出现故障.

In the last 24 hours, a previously working GMail plugin I run has started failing.

我一直将其简化为仅尝试从

I stripped it all the way down to only trying to get the example from the docs working:

var action = CardService.newAction().setFunctionName('composeEmailCallback');
CardService.newTextButton()
    .setText('Compose Email')
    .setComposeAction(action, CardService.ComposedEmailType.REPLY_AS_DRAFT);

// ...

function composeEmailCallback() {
  var thread = GmailApp.getThreadById(e.threadId);
  var draft = thread.createDraftReply('This is a reply');
  return CardService.newComposeActionResponseBuilder()
      .setGmailDraft(draft)
      .build();
}

在BUILD(未按下按钮)上,先前运行的GMail插件显示错误消息:

On BUILD (not on button press), the previously working GMail Addon displays the error message:

The value returned from Apps Script has a type that cannot be used by the add-ons platform. Also make sure to call build on any builder before returning it. Value: values {
  proto_value {
    type_url: "type.googleapis.com/caribou.api.proto.addons.templates.publicapi.ContextualAddOnMarkup.Card"
    value: "...(omitted)"
  }
}

这是一个新的已知问题吗?有人有一些疑难解答步骤要分享吗?

Is this a new, known issue? Does anyone have some troubleshooting steps to share?

推荐答案

对我来说,该错误是由未列入白名单的开放链接引起的.例如,如果您有这样的代码:

For me the error was was caused by open links not being whitelisted. For example, if you have code like this:

CardService.newOpenLink().setUrl(url)

然后将'url'返回的链接列入白名单.在应用程序清单的 openLinkUrlPrefixes 列表中,如下所示:

Then the link returned by 'url' has to be whitelisted in the appscript manifest's openLinkUrlPrefixes list, like so:

"openLinkUrlPrefixes": [
    "https://*.example.com"
]

这篇关于GMail Google Apps脚本插件“从Apps脚本返回的值具有附加平台无法使用的类型".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆