使用Google Apps脚本获取已发送文件夹中的未读数量 - GMail [英] Getting unread count in Sent Folder using Google Apps Script - GMail

查看:76
本文介绍了使用Google Apps脚本获取已发送文件夹中的未读数量 - GMail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在已发送文件夹中获取未读邮件?

Is there a way to get Unread Mail count in Sent Folder?

基本上,我想要的功能是:当我回复邮件列表中已过滤但未通过我的INBOX的邮件时,我希望所有后续回复都是到达我的INBOX。

Basically, the feature I want is: When I reply to a message in mailing list that's filtered and doesn't pass my INBOX, I want all the subsequent replies to be reaching my INBOX.

我试图完成的方式是,如果我在已发送文件夹中看到未读邮件,则表示我参与的线程中有新邮件。我这样说是因为当我点击Gmail网页界面中的已发送时,我发现这些邮件是未读的。

The way I'm trying to accomplish is that if I see a Unread Mail in Sent folder, that means that there is a new mail in a thread I was involved. I'm saying this because I see those mails as unread when I click "Sent" in Gmail's web interface.

那么,是否有办法获取未读数量系统标签?

So, is there a way to get unread count for a system label?

肮脏的方式:我可以做到这一点的一种方法是创建一个过滤器,选择所有包含from:的邮件作为我的地址并使用它来获取我想要。但是,这样我就创造了一个我感觉不太好的副本!

Dirty way: One way I could accomplish this is creating a filter that selects all mails that has "from:" as my address and use that to get what I want. But, this way I'm creating a duplicate of which I don't feel good about!

推荐答案

其中一件很棒的事情关于Apps脚本中的GmailApp,可以使用与Gmail相同的搜索功能(非常强大)。

One of the wonderful things about GmailApp in Apps Script is the ability to use the same search features that you have in Gmail (quite powerful).

要查看已发送文件夹中的所有未读邮件,请使用以下字符串进行搜索

To see all unread messages in Sent folder, search with the following string


是:未读标签:已发送

is:unread label:sent

类似

  var query = 'is:unread label:sent'; 
  var threads = GmailApp.search(query);

这篇关于使用Google Apps脚本获取已发送文件夹中的未读数量 - GMail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆