Gmail script: Filters, stars and gmailApp.search, but some emails fall through the cracks

烂漫一生 提交于 2019-12-06 14:47:05

Your first thread is not picking up mails correctly.

var threads = GmailApp.search('is:unread in:inbox -label:Starred -label:Sales');

You indicated that

I have a standalone script that searches inbox for unread email, and anything that isn't starred are removed from inbox and applied label.

GmailApp.search() should only use is:unread in:inbox for what you want. Also, using the search query parameter label: shouldn't have a dash before it.

Check out the documentation for the list of accepted search query parameters here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!