You need to sign in to do that
Don't have an account?
Matt Bostrom
Email-To-Case Filtering
Hi all,
I'm looking for an efficient way at filtering out some of the emails that come in to our Email Service Address so that it will not auto-create a case in SFDC if its from a particular email.
I am aware there is an Email to Case premium module but am not interested in paying for more that.
I've tried varous things like putting addError on the before insert of the EmailMessage (however this throws email exceptions and also won't work in bulk as it rolls back all DMLs and not just the ones with the errors).
I've also tried triggers on Case and EmailMessages to perform some checks and updates/deletes. That was working but has some problems on its own so I'd rather not continue down that path.
I'm looking for an efficient way at filtering out some of the emails that come in to our Email Service Address so that it will not auto-create a case in SFDC if its from a particular email.
I am aware there is an Email to Case premium module but am not interested in paying for more that.
I've tried varous things like putting addError on the before insert of the EmailMessage (however this throws email exceptions and also won't work in bulk as it rolls back all DMLs and not just the ones with the errors).
I've also tried triggers on Case and EmailMessages to perform some checks and updates/deletes. That was working but has some problems on its own so I'd rather not continue down that path.
I would put your trigger on the Case for a before trigger. Then fetch down all the EmailMessages for the cases (probably filtering on the Email origin) and then if the EmailMessage from address equals the one you don't want then change the OwnerId to your spam queue and set ContactId and AccountId to null. Then if you want to clean up that data you can write a scheduled job that will come along and delete them after the fact. Or you can leave them hanging around for X number of days/weeks/years for forensic work.