简体   繁体   English

使用Google Apps脚本获取已发送文件夹中的未读数量 - GMail

[英]Getting unread count in Sent Folder using Google Apps Script - GMail

Is there a way to get Unread Mail count in Sent Folder? 有没有办法在已发送文件夹中获取未读邮件?

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

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. 我试图完成的方式是,如果我在Sent文件夹中看到一个未读邮件,这意味着我参与的一个帖子中有一个新邮件。 I'm saying this because I see those mails as unread when I click "Sent" in Gmail's web interface. 我这样说是因为当我点击Gmail网页界面中的“已发送”时,我发现这些邮件未读。

So, is there a way to get unread count for a system label? 那么,有没有办法获得系统标签的未读数量?

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. 肮脏的方式:我可以做到这一点的一种方法是创建一个过滤器,选择所有包含“from:”的邮件作为我的地址并使用它来获得我想要的东西。 But, this way I'm creating a duplicate of which I don't feel good about! 但是,这样我就创造了一个我感觉不舒服的副本!

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). 关于Apps脚本中GmailApp的一个奇妙之处是能够使用与Gmail相同的搜索功能(非常强大)。

To see all unread messages in Sent folder, search with the following string 要查看已发送文件夹中的所有未读邮件,请使用以下字符串进行搜索

is:unread label:sent 是:未读标签:已发送

Something like 就像是

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM