We have the requirement that if a Case is created via email2case and the Account has a flag (SecureSupport__c) checked then we should block the case creation and send a notification to the contact that created the case saying "you can't do that."
I wrote a trigger that works correctly and does an addError on the record if the SecureSupport__c flag on the account is set. This works great. However any operation try to use to send the email never happens because the entire transaction is rolled back with the addError.
I have tried:
- Inserting a new object that fires a Workflow email
- Messaging.SingleEmailMessage in an @future call
None of these work. Is there a way that I am missing?
NOTE: I cannot let the case be created and then deleted later. It cannot stay as a record even for a little while