function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jadenjaden 

Email to Case Service

I have a request to parse an incoming email and create a case and possibly the account and contact from the information in the body of the email, that part is fine.  

 

However, the user also requested; 

that my inboundemailhandler should only fire when the the incoming email is from the email to case emailservice.

 

How do I limit that?  Do I test the fromaddress to be the long address (email services address)? 

 

Any suggestions, appreciated!

sfdcfoxsfdcfox
You configure a handler and bind it to one or more email addresses. By the very nature of this configuration, it will only fire when received at the appropriate address. You can restrict the origins to a list of email addresses or domains (or any combination thereof). Emails from unapproved addresses or domains will be bounced. There's no need to write any code for this.