选择了多封电子邮件messageMetadata.accessToken [英] Multiple emails selected messageMetadata.accessToken

查看:87
本文介绍了选择了多封电子邮件messageMetadata.accessToken的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过插件处理多个选定的电子邮件? Google的代码显示了如何仅处理一封选定的电子邮件.我想'e'是某种访问令牌数组,但我不知道如何访问它.

Is it possible to process multiple selected emails by an addon? The code from Google shows how to process only one selected email. I suppose 'e' would be some kind of array of accesstokens but I don't know how to access it.

function getContextualAddOn(e) {
  var accessToken = e.messageMetadata.accessToken;
  Logger.log("token:"+ accessToken);
  GmailApp.setCurrentMessageAccessToken(accessToken);
  var messageId = e.messageMetadata.messageId;

  var card = createCard();
  return [card.build()];
}

谢谢.

推荐答案

您的Apps脚本代码永远不会在客户端设备上运行,该客户端设备在Gmail UI中选择了邮件-它运行在Google的服务器上.您无法通过加载项访问UI信息(没有 GmailApp.getSelectedThreads() CardService.getActiveEmails() , 等等.).您只能访问打开的消息/草稿,以及其他消息(或邮箱),它们取决于您的

Your Apps Script code never runs on the client device, where the messages are selected in the Gmail UI - it runs on Google's servers. You can't access UI information from add-ons (there's no GmailApp.getSelectedThreads(), CardService.getActiveEmails(), etc.). You are only able to access the opened message / draft, and others in the same thread (or mailbox, depending on your add-on's scopes).

触发的回调函数收到的事件对象将只有一个访问令牌.直到添加其他清单触发器(当前仅 contextual

The event object received by your triggered callback function will only have a single access token. Until additional manifest triggers are added (currently only contextual and compose exist), this won't change.

由于它不是Google,因此这里没有人可以告诉您是否或何时添加或不添加其他触发器.最好的选择是请求功能

As this is not Google, no one here can tell you if or when other triggers may or may not be added. You best bet is to request the feature.

这篇关于选择了多封电子邮件messageMetadata.accessToken的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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