I don't think this needs google apps script, try to create a GMail filter matching the sender's email, then select "Delete it" as the action.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/93c5782e-e78d-4bad-afe8-73c0860ed1d7%40googlegroups.com.
That only sends it to the trash where it's still visible to the user (I'm helping someone else with this). What we're looking for is a way for the email to be entirely removed from gmail without the user being aware an email was received in the first place.
On Mon, Sep 23, 2019 at 2:43 AM ChiefChippy2 <soloui...@gmail.com> wrote:
I don't think this needs google apps script, try to create a GMail filter matching the sender's email, then select "Delete it" as the action.--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Advanced Gmail Service can permanently delete it.
Apply the filter and the code below ( add a time trigger and authorize it correctly )
function example(){var NotWanted= GmailApp.search("is:trash from:em...@em.ail")var arrayId=[]for(var i =0;i<=NotWanted.length;i++){arrayId.push(NotWanted[i].getId())}
UrlFetchApp.fetch("https://www.googleapis.com/gmail/v1/users/me/messages/batchDelete",{"method":"POST","payload":{"id":arrayId}})
}(Try this code there might be an error or two )
On Monday, September 23, 2019 at 6:28:42 PM UTC+2, cwlind wrote:
I don't know if Apps script can do more than move a message or thread to Trash or Spam. I don't know of any method to "Empty Trash".
On Monday, September 23, 2019 at 10:35:50 AM UTC-4, Dave Powell wrote:
That only sends it to the trash where it's still visible to the user (I'm helping someone else with this). What we're looking for is a way for the email to be entirely removed from gmail without the user being aware an email was received in the first place.
On Mon, Sep 23, 2019 at 2:43 AM ChiefChippy2 <soloui...@gmail.com> wrote:
I don't think this needs google apps script, try to create a GMail filter matching the sender's email, then select "Delete it" as the action.--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/93c5782e-e78d-4bad-afe8-73c0860ed1d7%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/57c035e7-0d95-4221-8e98-9a794b3d9526%40googlegroups.com.
Thanks! It ran, requested permissions, and then dumped this error. Using the email from your example for now.TypeError: Cannot call method "getID" of unidentified. (line 6, file "Code")Running the debug I get this:
On Mon, Sep 23, 2019 at 10:51 AM ChiefChippy2 <soloui...@gmail.com> wrote:
Advanced Gmail Service can permanently delete it.Apply the filter and the code below ( add a time trigger and authorize it correctly )function example(){var NotWanted= GmailApp.search("is:trash from:em...@em.ail")var arrayId=[]for(var i =0;i<=NotWanted.length;i++){arrayId.push(NotWanted[i].getId())}UrlFetchApp.fetch("https://www.googleapis.com/gmail/v1/users/me/messages/batchDelete",{"method":"POST","payload":{"id":arrayId}})}(Try this code there might be an error or two )
On Monday, September 23, 2019 at 6:28:42 PM UTC+2, cwlind wrote:
I don't know if Apps script can do more than move a message or thread to Trash or Spam. I don't know of any method to "Empty Trash".
On Monday, September 23, 2019 at 10:35:50 AM UTC-4, Dave Powell wrote:
That only sends it to the trash where it's still visible to the user (I'm helping someone else with this). What we're looking for is a way for the email to be entirely removed from gmail without the user being aware an email was received in the first place.
On Mon, Sep 23, 2019 at 2:43 AM ChiefChippy2 <soloui...@gmail.com> wrote:
I don't think this needs google apps script, try to create a GMail filter matching the sender's email, then select "Delete it" as the action.--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/93c5782e-e78d-4bad-afe8-73c0860ed1d7%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.