微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Google Apps 脚本,Gmail UI 插件,如何删除抄送收件人?

如何解决Google Apps 脚本,Gmail UI 插件,如何删除抄送收件人?

我的第一个问题... :)

在 Gmail UI 插件中,我想删除抄送收件人:

function onGmailCompose(e) {
  var buttonSet = CardService.newButtonSet()
      
      .addButton(CardService.newTextButton().setText('Example Button')
                  .setonClickAction(CardService.newAction().setFunctionName('ButtonAction'))
                  .setTextButtonStyle(CardService.TextButtonStyle.FILLED));

  var card = CardService.newCardBuilder()
      .setHeader(CardService.newCardHeader().setTitle('Choose...'))
      .addSection(CardService.newCardSection().addWidget(buttonSet));
  
  return card.build();
}

function ButtonAction(e) {
  Logger.log(e);

  var response = CardService.newUpdateDraftActionResponseBuilder()
        .setUpdateDraftCcRecipientsAction(CardService
            //this works fine
            .newUpdateDraftCcRecipientsAction().addUpdateCcRecipients(['jon.doe@example.com']));
            
            //but how to clear CcRecipients?

            //this doesn't work.
            //.newUpdateDraftCcRecipientsAction().addUpdateCcRecipients([]));

            //neither this.
            //.newUpdateDraftCcRecipientsAction().addUpdateCcRecipients());

            //neither this.
            //.newUpdateDraftCcRecipientsAction().addUpdateCcRecipients(['']));

  return response.build();
}

文档没有多大帮助:

https://developers.google.com/apps-script/reference/card-service/update-draft-cc-recipients-action

有什么想法吗?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。