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

How do I track emails that I send from within a case
Hi guys,
How can I keep records of emails that I send to clients from within the case record. So I am able to send an email to a client from within the record, fine. None of the replies are being added to the record.
Am I missing something?
How can I keep records of emails that I send to clients from within the case record. So I am able to send an email to a client from within the record, fine. None of the replies are being added to the record.
Am I missing something?
Review the following to ensure that Email-to-Case has been set-up correctly for customer Email responses to be attached to and viewed from the case.
1. The Thread ID needs to be added to either the Subject of the Email, the body of the Email or both. It is recommended that it be added to both. This will give Salesforce a better chance of locating the case. Also, if a customer removes the Thread ID from one or the other there is a back up. To add the Thread ID follow the steps below:
Your Name | Setup | Customize | Cases | Email to Case
2. When replying to a customer always change the address from the Owner to the Email to Case support address. If this is not changed then the response from the customer will be sent to the owner of the case and will not be added to the Email Thread.
3. Add the Email Related list to the Case Layout. When a customer replies to an email that has the Thread ID the Salesforce will identify the case via the Thread ID, the Case Owner will be sent a notification, and the Email will be added to the Email Related List. To add the Related List to the Case Layout:
Your Name | Setup | Customize | Cases | Page Layouts
- Select the Layout in question and select edit
- Click on Related Lists
- Drag and Drop "Emails" to the Page Layout
- Save
4. A common issue when testing Email-to-Case before deployment or when testing in the Sandbox the support address has not been forwarded to the Email Services Address. If you have not already done this then the replies are not hitting Salesforce and cannot be attached to the case. Contact your Email Administrator to have them forward the emails to the Services Address.
Some more additional help - http://help.salesforce.com/apex/HTViewHelpDoc?id=cases_email.htm
Cheers,
Prashanth
www.autorabit.com
use thread id in the reply email so sfdc automaticallly add those emails to case.
for further details user following link-
http://help.salesforce.com/HTViewSolution?id=000176597
Thanks, Vikas
I have already setup Email-to-Case and it works fine. My question is that if I reply to an email from within the Case object the email that is sent out is from my email address, because that is the email address that is associated to my user account and I am the Case record owner.
So as a result of this do I need to manually add the thread each time I reply to an email or want to collaborate with a client, in order for the emails to be logged in that record?
No manual addition is needed.
May be you are not inserting email in EmailMessage Object.
after inserting email to Case add folloeing code snippet to it.
add your logic to extract parentId(i.e Case id) so that email will be attached to appropriate Case.
Besy Regards,
Amit Ghadage.
I don't understand. Where do I add this code? To the cases trigger?
What does this trigger do? Also What do you mean by "after inserting email to Case"? Do you mean to setup the email to case to include my personal email address?
I have already setup email to case and added a generic email address. This is only to be used when clients want to submit a case via email. If a user is replying to the clients email, I want the From email to be the users email address.
Does your solution above cover this?
you have to write this code in your Email Service class.
Best Regards,
Amit Ghadage.
It doesn't work. This is what I have done:
Ok, but what will the output of this be? Will the result be that any email I send from within a case record and replies to those emails will be recorded on the Salesforce record?
Do I add this as an Apex Class first and then add that Apex Class to the Email Service?
Yes Incoming replies and outgoing emails of Case will be added to related list of Case.
Can you please send me any generated thread id? Just want to check format.
Hey NevDev,
you want from address to be added in the email while replying means.
you can do it in 2 Ways.
1. using an organization-wide address add your email service address and verify and u can use your email Id and u can reply.
2. Go to standard object / Go to Buttons, Links, and Actions/search for email and open that at bottom there are predefined values / click new and add from address. after saving u will get from address in standard object email reply also and from google mail if u reply u need not change to address too. u can directly reply from there.
1. you can change your forwarding mail address to that email service address. then u can use user org Id. else
2. go through organization-wide address. it will work.
global class Caseinboundmassage implements Messaging.InboundEmailHandler{
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email,Messaging.InboundEnvelope env){
Messaging.InboundEmailResult result = new Messaging.InboundEmailResult();
//how we can get from address
String conemail = email.fromAddress;
system.debug('conemail====='+conemail);
//check contact have this email
contact con = [SELECT id,Name FROM Contact WHERE email =: conemail limit 1];
system.debug('Contact is'+con);
if(con != null){
//creat case
Case cas = new Case();
cas.contactid = con.id;
cas.Subject = email.subject;
cas.Origin = 'Email';
cas.Status = 'New';
cas.Priority = 'low';
cas.Description = email.plainTextBody;
try{
insert cas;
result.success = true;
}Catch(DMLException e){
system.debug('Following error message occured==== '+e);
result.success = False;
}
if(email.textAttachments != null)
{
// Save attachments, if any
for (Messaging.Inboundemail.TextAttachment tAttachment : email.textAttachments) {
Attachment attachment = new Attachment();
attachment.Name = tAttachment.fileName;
attachment.Body = Blob.valueOf(tAttachment.body);
attachment.ParentId = cas.Id;
insert attachment;
}
}
if(email.binaryAttachments != null)
{
for (Messaging.Inboundemail.BinaryAttachment bAttachment : email.binaryAttachments) {
Attachment attachment = new Attachment();
attachment.Name = bAttachment.fileName;
attachment.Body = bAttachment.body;
attachment.ParentId = cas.Id;
insert attachment;
}
}
}else{
system.debug('Contact Not Exist');
}
return result;
}
}
please choose Best answer
Thanks!!!