I need to have a rule to cleanse old email messages, but keep the case & activity records. It seems this is possible to do manually (find the case, click into the task, click into the related email message > Delete) but I'd like to set up a rule to cleanse in an ongoing manner.
Ideally each night, I want to be able to delete related email messages for cases which have been "closed" for over 60 days. Any recent/open cases we would want to keep everything. We have a backup system for our instance so that if we needed to find a very old email we could dive into the archive.
What would be the best way to go about this? Would it be an Apex trigger, a workflow rule etc?