I have created an email service based on the Salesforce documentation found at the following address:
https://help.salesforce.com/apex/HTViewHelpDoc?id=code_email_services_editing.htm
The only issue is that my class (which clearly impliments the InboundEmailHandler) is not being recognised as a compatible email service class.
My class:
global class processEnquiryEmail implements Messaging.InboundEmailHandler {
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
Inbound_Email__c ie = new Inbound_Email__c();
ie.From__c = email.fromname;
ie.Body__c = email.plainTextBody;
ie.Subject__c = email.subject;
ie.Email__c = envelope.fromAddress;
try{insert ie;}
catch(Exception e){
system.debug('There was an error processing the email. ' + ie); }
return result;
}
}
and I am getting the following error when i try to activate my email service:
The Apex Class selected is not valid. An Apex Class that implements the Messaging.InboundEmailHandler interface must be selected.
Does anyone know why I can not use the above class in my email service? What is making it incompatible?