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?