Gmail – Automatic organization of confirmations/rejections in Gmail

gmailgoogle-apps-script

I need to manage better my email into Gmail. I can receive two possible email messages: one for confirmation and the latter for rejection. A rejection email will come after a previous confirmation.

Basically, when I receive a confirmation email (the term confirmation is enclosed within the email text) I should organize that email in a dedicated folder 'Confirmation' (with a label). When I receive a rejection I should organize the rejection email with rejection label and delete the related confirmation.

The text in bold is the most important part that I don't know how to address.

Is it possible with Gmail, perhaps with a Google script?

Best Answer

Unfortunately, no, you can't do what you want with Gmail filters alone. You can organize the various messages, but there's no way to get Gmail to automatically delete a different email message with a filter.

There may be a third-party add-on that will do something like this, but asking (and answering) questions for recommendations is beyond this site's scope.