What is if the sender of the last article is an agent? Then the agent would get the closing notification?
I had a similar problem and i solved this with the following workflow:
All Agents have a macro „Close ticket“. The macro set the ticket to „pending close“ in 24hrs, so if a customer replies to the last agent action, the ticket gets open again and the closing process is interupted.
Then i created a new ticket state „to close“. I updated the following state from the „pending close“ state to the new created state. Imho this must be done via the rest api or the zammad console. Normally, the following state is „closed“ and the notification trigger wont work.
Now when the ticket state changes from „pending close“ to the new „to close“ state, i can do an automation, which looks a couple of times a day for tickets with the „to close“ state and closes them, set a tag „already closed“ (so the customer will get the closing note only once) and send an email to the customer, that his ticket is now closed.