我的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();