Search Community
- Force.com Discussion Boards
- :
- Salesforce User Discussions
- :
- Best Practices Discussion
- :
- Re: Email-to-Case Auto-response email loop
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
- Next »
Re: Email-to-C ase Auto-respo nse email loop
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
11-06-2009 12:04 AM
We've created a trigger that seems to work pretty well.
We had a pretty bad experince the other day with a game of auto-response tennis creating well over a thousand cases.
We've created the following trigger that in initial testing seems to work pretty well.
This is just a re-worked version of Curry-Man's code
trigger LoopKiller on Case (before insert) {
/*
* Email Loop Killer
* Will not process new email if there are atleas
* the same email with the same subject and the p
*/
case[] c = trigger.new;
case[] check = [select ID, CreatedDate, subject
system.debug(c[0].SuppliedEmail);
system.debug(c[0].subject);
if(c[0].Subject != null) {
//We have a subject, proceed.
if(c[0].subject.contains('[ ref:')){
//No Errors. Email should be attached to th
}else{
if(check.size() > 3){
if((check[0].createddate.addMinutes(5) > S
c[0].addError('Automatic email loop has
//Loop Was Killed.
}else{
//New Case should be created now!
}
}
}
}
}
Re: Email-to-C ase Auto-respo nse email loop
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-22-2010 07:16 AM
Our approach to email loop protection was to "flag" the case subject and add a filter/exclusion criteria to our auto-response or workflow rules to prevent the auto-response. By "flag", I mean that we pre-pend "Email Loop Protection" to the subject line and use a "Does Not Contain" filter to prevent the auto-response from triggering.
We didn't want to stop processing emails and creating cases just in case there was a valid reason why multiple emails should be received.
Something to keep in mind when designing your trigger. This is also part of Email to Case Premium on the AppExchange
- « Previous
- Next »

