I need to create a Google App Script to respond to machine generated emails, except those also sent to one colleague or contain a particular topic outside my responsibility.
I've been trying to use the GmailApp.search
API which includes all mail from user X but NOT those emails which are also addressed to user Y NOR those containing "junk_term". I want the emails archived and to skip the inbox.
I created a query like so:
"from:(user_X@address.com) -{user_Y@address.com OR junk_term}"
But it appears not to return any results.