+ Start a Discussion
Danny IncompanyDanny Incompany 

Where to find Inbox emails on Email Service

Hi,

We have developed an apex class using the email service functionality. Everything works fine, emails sent to the long email service, are properly capture and sent to the correct object. With all info.

This is a service for end customers so providing a looong email service is not an option. So to resolve this what we are doing is using a short custom email (with google apps) and a forward all to the looong email service.

We have done this in the past and basically google email sents a confirmation number in order to approve the redirection. This confirmation number comes in a automated email which in the past we have succsefully find in the "Unresolved items", however this shortcut is not available anymore.

Any ideas where we can check the "Inbox" for this email service? In order to find the confirmation code sent by google and approve the redirection? Or where is this unresolved items?

Thanks, any help greatly appreciated.
MaxPowerForceMaxPowerForce
There is no inbox for messages processed by an email service.   The handling of the messages is up to the email service class.  If your email service does not log the automatic messages from Google anywhere, you might add logic to output the message body to the debug log (it might be too long though) or implement a different email service class that logs the message to an object, switch the email service to this class, verify the address, then change the class back.

This simple email service should be sufficient to do this.  It will log the message to a case.
global class caseEmailer implements Messaging.InboundEmailHandler {
  
      global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope) {
          case c = new case(subject = email.subject, description = email.plainTextBody);
          insert c;
          
          Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
          return result;
      }
  }