You need to sign in to do that
Don't have an account?

Email service Email Address
Hello All,
I have created an email service that allows the user to send an email from the Lead object in Salesforce and have the replied email be attched to the Lead record as a Task.
The issue is that if the Customer does not select "Reply All" the replied to email will not get associated back to the Lead record because the email service email address is being added to the email and is not hte default from email address.
So is there a way to make Email Service Email Address selectable? Or can the Email Service Email Address be an organizational wide email address?
Thanks,
M
I have created an email service that allows the user to send an email from the Lead object in Salesforce and have the replied email be attched to the Lead record as a Task.
The issue is that if the Customer does not select "Reply All" the replied to email will not get associated back to the Lead record because the email service email address is being added to the email and is not hte default from email address.
So is there a way to make Email Service Email Address selectable? Or can the Email Service Email Address be an organizational wide email address?
Thanks,
M
You need to debug myPlainText in code after line number 13 then you can verify that email service after copy verification link from debug log.
During sending you will send from number as Email service Address then reply will auto route and above code will work.
All Answers
(We don't want to show the record ID to email receipent so we can add font color as white) When they reply you can parse the lead id in email service class and query related lead. Then its easy for you to related task with original record.
Thank you for the reply. Does this syntax need to be added to an HTML email template?
Also, here is my code : I tried modifying th Class to include the variable Id but I keep getting an error.
Currently the Salesforce users are just clicking the 'Send an Email' button the Lead record so the email body is free form.
Thanks,
M
If you are using HTML Email template then its little easy. Add below line as last line of email template Now your code will be modified as bellow
Let me know if still any issues
This above approach is the best we can use it to hide anything in the HTML Email Template..
Really Impressive.
Thank you for the reply. The replied email is not going back to the initial Lead record. Could it be an issue that the Lead Id field is in the HTML body and not a plain text body?
Cheers,
M
Please debug relatedRecordId. I think any extra character is coming after record id in variable relatedRecordId.
If yes then take first 15 character (After trim) from variable relatedRecordId in code then it will fetch initial Lead record. In Email template we have option to "Copy text from HTML version" in Text-Only Email Content, so html body or plain text body will not cause issue.
I am not seeing a log in the Developer Console when I reply to the email. I do not think its triggering the email service. So I put my original code back in and debugged for the Lead ID in the body of the Email and I could see the Id so that work and it created the activty but I have to include the Email Service email and had to reply all to the email.
Do I need to do something with the Email Service?
Thanks,
M
Thanks,
M,
Still not working. I do not see any activity in the logs where the Email service is even triggering on teh reply.
Is it my Email Service Configuration? I left the 'Accept Email from' blank which I thought would accept all email. Is this not corrrect?
Can you please check if user is replying on the email service email address?
Also "Email Service" and "Email Service Address" both are active?
If yes then debug log must be created for Email Service apex class
How can the user reply to the email service email address?
Here is what the user sees when they are sending an email.
Now if I add it to the email service email address to CC and the user replies all then yes the Email Service Apex Class is triggered.
You need to debug myPlainText in code after line number 13 then you can verify that email service after copy verification link from debug log.
During sending you will send from number as Email service Address then reply will auto route and above code will work.
"Undeliverable: Sandbox: Verify your Salesforce Organization-Wide Address"
Recieved error in my inbox
Here is the Class:
Thats why I have mentioned "You need to debug myPlainText in code after line number 13 then you can verify that email service after copy verification link from debug log."
Please clieck Resend in "Organization-Wide Email Addresses", then copy verification link from debug log.
Let me know if issue in this one time setup.
You can find the "Click this link to confirm this Organization-Wide Email Address" in debug log.
Verify the email by using this link
Then you can copy verification link from debug after resenindg from Organization-Wide Email Address.
Hope it works :)
Thanks again for all of your help and patience.
M