Setup Email Services
You can configure the Email Services to handle the inbound messages. Perform the following steps to manually set up Email Services:
- Click on the ‘Settings’ icon on the Salesforce navigation bar and then click on the ‘Setup’ button
- Select Email Services in one of the following ways:
- Use the Search Setup/Quick Find search field, or
- Select Platform Tools > Custom Code > Email Services
- Click on the ‘New Email Service’ button as shown in the image below:
![New Email Services](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/New-Email-Services-1024x478.png)
- The following window will appear:
![Setup new email service](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Setup-new-email-service-1024x468.png)
- Enter ‘NotificationReplyService’ in the ‘Email Service Name’ field. This is a mandatory field.
- Enter ‘EmailToTextServiceHandler’ in the ‘Apex Class’ field. This is a mandatory field.
- Do not enter values in the ‘Accept Email From’ text box
- Click on the ‘Active’ checkbox to enable the email services
- Click on the ‘Save and New Email Address’ button. If the user gets the following error while creating an email service:
Error: The Apex class selected is not valid. An apex class that implements the Messaging.InboundEmailHandler interface must be selected.
Follow the below additional steps to complete the configuration
- Go to the ‘Setup’ page in the org
![Go to the Setup](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Go-to-the-Setup-1024x508.png)
- Search ‘Apex Classes’ in the quick find and open the page
- Click on the ‘Compile all classes’ link and wait until it finishes compiling
![Search Apex Classes](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Search-Apex-Classes-1024x502.png)
- Once the compilation is complete, you will get the following message saying, ‘Compilation Complete’:
![Complilation Complete Apex Classes](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Complilation-Complete-Apex-Classes-1024x195.png)
- Go to the email service page and now try to save the email service. The following window will appear:
![Try to Save the Email Services](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Try-to-Save-the-Email-Services-1024x569.png)
- Enter the name in the ‘Email Address Name’ field and click on the ‘Save’ button. The following window will appear:
![Email Service NotificationReplyService](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Email-Service-NotificationReplyService-1024x536.png)
- Once you complete the email notification configuration as mentioned in the following ‘enable notification’ section by selecting the newly created email service address against the ‘Reply-To address’ field, upon receiving an incoming message, the system will send the email notification to the user assigned with Sender ID.
![Enable Notificagtion on Email Service](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Enable-Notificagtion-on-Email-Service-1024x382.png)
When the ‘Send Email Notification From’ field is not configured, you will see the oAuth user email address as ‘From email ID’ and you will see the above created ‘Reply-To address’ in the ‘Reply-To’ email ID field in the email composer as shown below:
![Message Recieved Notificaion](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Message-Recieved-Notificaion-1024x243.png)
![Reply Over Notification Email](https://www.sms-magic.com/docs/salesforce/wp-content/uploads/sites/2/2020/07/Reply-Over-Notification-Email-1024x528.png)