0

我的 Gmail 附加组件发送一封电子邮件,然后使用 API 显示一条通知,其中ActionResponseBuilder.setNotification包含信息消息“已发送邀请电子邮件。 ”。这一切都很好。

我的问题是如何在通知中添加新电子邮件的链接。我认为这是可能的,因为本地 Gmail 通知在发送电子邮件时会这样做。它显示“您的消息已发送。查看消息”,其中“查看消息”是一个链接。

GmailApp.setCurrentMessageAccessToken(e.messageMetadata.accessToken);
var mail = GmailApp.getMessageById(e.messageMetadata.messageId);
mail.replyAll("Test email");

return CardService.newActionResponseBuilder()
  .setNotification(
    CardService.newNotification()
      .setText('Invite email sent.')  // how to add a link to new email
      .setType(CardService.NotificationType.INFO)
  )
  .build();

作为参考,包含该链接的手动发送电子邮件的通知。 在此处输入图像描述

4

0 回答 0