Send alert on incoming e-mail from customer, prevent alert on incoming e-mail from agent

Send alert on incoming e-mail from customer, prevent alert on incoming e-mail from agent

Hello,

Here is what I would like to achieve:
I want to send an alert to the customer (to the contact associated with the ticket) when the ticket meets certain criteria (for example, when it is closed). But this should not happen if an agent forwards an email to Desk and in the subject is the ID of the ticket, so if the agent links an email to the corresponding ticket. Then, of course, the customer should NOT be informed.