我的加载项不会在SPAM文件夹中的邮件上运行 [英] My add-on will not run on messages in the SPAM folder

查看:58
本文介绍了我的加载项不会在SPAM文件夹中的邮件上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试激活垃圾邮件文件夹中邮件的附件时,它告诉我垃圾邮件和可疑邮件不能用于推荐的内容或操作".我该如何运作?

When I try to activate my add-on for a message in the SPAM folder it tells me "Spam and suspicious messages can’t be used for recommended content or actions." How do I make it work?

function getContextualAddOn(event) {
  var message = getCurrentMessage(event);

  var card = createCard(message);

  return [card.build()];
}

/**
 * Retrieves the current message given an action event object.
 * @param {Event} event Action event object
 * @return {Message}
 */
function getCurrentMessage(event) {
  var accessToken = event.messageMetadata.accessToken;
  var messageId = event.messageMetadata.messageId;
  GmailApp.setCurrentMessageAccessToken(accessToken);
  return GmailApp.getMessageById(messageId);
}

function createCard(message) {
  var emailFrom = message.getHeader("return-path-1");
  var card = CardService.newCardBuilder();
  card.setHeader(CardService.newCardHeader().setTitle("Forward e-mail"));
  
  var statusSection = CardService.newCardSection();
  statusSection.addWidget(CardService.newTextParagraph()
     .setText("<b>Sender: </b>" + emailFrom ));
  card.addSection(statusSection);
  
  var formArea = CardService.newCardSection();
  var widget = CardService.newTextInput()
    .setFieldName("forwardTo")
    .setTitle("To:");
  
  formArea.addWidget(widget);
  card.addSection(formArea);
  
  return card;
}

推荐答案

Gmail附加组件当前无法处理 SPAM 文件夹中的电子邮件.

有关此功能的问题跟踪器中有一个打开的功能请求:

Gmail add-ons cannot currently handle emails inside the SPAM folder.

There is an open Feature Request in Issue Tracker regarding this functionality:

我建议您加注星标,以便对其进行优先排序并跟踪所有更新.

I'd suggest you to star this issue, in order to prioritize it and to keep track of any updates.

将电子邮件移到 SPAM 文件夹之外,转发电子邮件或您拥有的电子邮件,然后再通过附件与之交互.

Move the emails outside the SPAM folder, forward them, or what have you, before interacting with them through the add-on.

这篇关于我的加载项不会在SPAM文件夹中的邮件上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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