Looping on messages (not threads) of a specific Gmail label(循环播放特定 Gmail 标签的邮件(不是线程))
问题描述
我通过以下步骤将特定的消息(而不是整个线程)添加到标签to_process
:
I added specific messages (and not the whole thread) to a label to_process
with these steps:
在 Gmail 设置中关闭
对话模式
将标签 to_process
应用于特定消息
Apply the label to_process
to specific messages
显示消息时,我可以确认只添加了特定的消息.例如,同一线程中的另一条消息没有此标签.这很好.
When displaying the messages, I can confirm that only the specific messages have been added. For example, another message which is in the same thread doesn't have this label. This is good.
现在我想循环播放来自 Google Apps 脚本的所有这些消息.但问题是 API 只能授予对附加到某个标签的 threads 的访问权限:
Now I'd like to loop on all these messages from Google Apps Script. But the problem is that the API can only give access to threads attached to a certain label:
var threads = GmailApp.search('label:to_process');
for (var i = 0; i < threads.length; i++) {
// problem: here I cannot access to messages but only threads
}
或
var label = GmailApp.getUserLabelByName("to_process");
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
// problem: here I cannot access to messages but only threads
}
如何循环播放与标签关联的消息(而不是线程)?
开始解决方案,但我不知道如何继续:
Beginning of a solution but I don't know how to continue:
var threads = GmailApp.search('label:to_process');
for (var i = 0; i < threads.length; i++) {
var messages = threads[i].getMessages();
for (var j = 0; j < messages.length; j++) {
var message = messages[j];
// pseudo code here because getMessageLabels doesn't exist
//if ("to_process" is in message.getMessageLabels()) {
/
本文标题为:循环播放特定 Gmail 标签的邮件(不是线程)
- 从原点悬停时触发 translateY() 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01
- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01