使用Google App脚本获取gmail中的当前线程ID [英] get current thread id in gmail using google app script
本文介绍了使用Google App脚本获取gmail中的当前线程ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在构建一个Gmail加载项.我想使用Google Apps脚本获取当前打开的电子邮件线程的线程ID .我试图在Google Developers文档中找到 GmailApp .但没有发现相关的内容.
I am building a Gmail Add-On. I want to get the thread Id of current open email thread using Google Apps Script. I tried to figure out in Google Developers documentation for GmailApp. But nothing found relevant.
推荐答案
您可以从 buildAddOn的
.使用此方法,您可以按以下方式检索 e.messageMetadata.messageId
中检索当前消息的 messageId
.(e) threadId
.
You can retrieve messageId
of the current message from e.messageMetadata.messageId
of buildAddOn(e)
. Using this, you can retrieve threadId
as follows.
var threadId = GmailApp.getMessageById(messageId).getThread().getId();
参考文献:
- getMessageById()
- getThread()
如果这不是您想要的,对不起.
If this was not what you want, I'm sorry.
这篇关于使用Google App脚本获取gmail中的当前线程ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文