Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete/Trash sent email #416

Open
robocrax opened this issue Nov 18, 2021 · 1 comment
Open

Delete/Trash sent email #416

robocrax opened this issue Nov 18, 2021 · 1 comment

Comments

@robocrax
Copy link

Hi, after successfully sending the email. Is it possible to delete the sent email or move it to trash once sent?

@mckennapsean
Copy link
Collaborator

So MailApp (what we use to send emails in Google Scripts), only lets you send email or check your quota.

What did you try searching for to do this?

I did a quick google search using "google apps script delete email once sent" & came up with some of these links, which will delete way more than you may want, but you can tweak the parameters most likely. You may want to have a way to easily identify the sent emails, with a very specific/custom subject name or adding some unique tag to the body. Then, perform a search for emails that match that criteria & flag it. Some of the possible helpful pages:

Note: it is possible that MailApp doesn't immediately send an email right then and there. As a result, if you clean up emails in Gmail via Google Script, there may not be anything to clean up just yet. You can fix that by moving the clean up to its own script & have that run at given intervals on your inbox.

Is that helpful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants