Inbound Email Processing Error: INVALID_TYPE_FOR_OPERATION
Using Email to Case Premium, you have received an email notification with the following error:
An error occurred while trying to deliver the attached email. You may wish to report the following information to the owner of email@example.com.
The apex class E2CP.ProcessMessage failed due to: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_TYPE_FOR_OPERATION, Only User, Contact, Lead, or Person objects are allowed for targetObjectId: 00GXXXXXXXXXXXX.: [targetObjectId, 00GXXXXXXXXXXXX]
The attached email could not be processed because the Apex class E2CP.ProcessMessage failed.
Class.E2CP.ProcessMessage.distributeMessage: line 1550, column 1
This error indicates that you have enabled Email Distribution, but have not configured Contact Substitution.
To prevent this issue, configure Contact Substitution according to the following documentation: