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
Zoom_VZoom_V 

Using an Email Service and InboundEmailHandler for an Email Alert

I am attempting to use an InboundEmailHandler class with an Email Service - and then to use that Email Service in an Email Alert which will be triggered from a Workflow upon the creation of a new record for an object. 

However, I have some questions for which I am having trouble finding answers : 

How do I assign the Email Service to the Email Alert so the Email Alert will always use it when triggered ? 

Also - this may be a silly question, but will this Email Service ONLY be used for that specific Email Alert ? I have read horror stories of Email Services becoming the default for ALL Email Alerts of an Org once activated.

And yet : Is there a way of testing this in Sandobox ? I'm currently attempting to just send emails to a User with a known valid email address and they are not sending. Is there something which needs to be activated in the Sandbox in order for this to work ?

Thank you very much.

Suraj GharatSuraj Gharat
Email Alert and Email Service are two different features of the Force.com platform and can exist independently. Email Alert is an action that could be used to send emails based on any configured Workflow rule and/or Approval process. On other hand, Email Service is the Apex code that processes emails sent to a particular email address (Salesforce generated), where we can manipulate records as per our requirements based on incoming email's content.

We can also write Apex test for Email Service. You may refer below link for this.

http://blog.jeffdouglas.com/2010/03/12/writing-an-inbound-email-service-for-salesforce-com/
Zoom_VZoom_V
Ok - and the only time that Email Service comes into play is when an email comes in to the Email Services' address, correct ? 
Zoom_VZoom_V
How do I make the Email Services' address the From for the Email Alert that will be sent ? I want it to be the From so the recipient can just Reply and it would trigger the Email Service and the Apex code.
Jonathan Pachon ArizaJonathan Pachon Ariza
Hi Zoom_V
I have the same question. I would like to know if you already found the answer for this.

Thank u
Regards.