You need to sign in to do that
Don't have an account?
Tony White (BNE)
Why is the case owner getting a copy of the email to the case contact?
We have a trigger using a single email message to send an email to a contact on a case, and save it as an activity on the case/contact. But we are finding that the case owner is also getting a copy of the email. Why?
This is the send email code we are using:
--------
Messaging.SingleEmailMessage singleMail = new Messaging.SingleEmailMessage();
//set object Id
singleMail.setTargetObjectId(contact.Id);
//set template Id
singleMail.setTemplateId(TemplateName));
// Set the whatId
singleMail.setWhatId(case.id);
//flag to true for inserting activity history
singleMail.setSaveAsActivity(true);
// Set the from address
singleMail.setOrgWideEmailAddressId(noReplyAddress.ID);
//add mail
emails2Send.add(singleMail);
....
Messaging.sendEmail(emails2Send);
This is the send email code we are using:
--------
Messaging.SingleEmailMessage singleMail = new Messaging.SingleEmailMessage();
//set object Id
singleMail.setTargetObjectId(contact.Id);
//set template Id
singleMail.setTemplateId(TemplateName));
// Set the whatId
singleMail.setWhatId(case.id);
//flag to true for inserting activity history
singleMail.setSaveAsActivity(true);
// Set the from address
singleMail.setOrgWideEmailAddressId(noReplyAddress.ID);
//add mail
emails2Send.add(singleMail);
....
Messaging.sendEmail(emails2Send);