You need to sign in to do that
Don't have an account?
Jeffrey Ko
Question on Apex SingleEmailMessage - how to prevent sender from getting copied (i.e. CC) in outbound messages
I am currently working on an Apex trigger, such that when the Account Name is modified, it will send an email to a specific list of email addresses defined in a custom setting. I am using the SingleEmailMessage API to do this, and the email uses a a plain-text email template.
I am facing 2 issues right, which I am hoping someone may know the answer to:
Any help or suggestion will be appreciated.
Thanks,
Jeffrey
I am facing 2 issues right, which I am hoping someone may know the answer to:
- Whenever Person A changes the Account Name, it sends the email to person_b@test.ca (mailto:person_b@test.ca) and person_c@test.com (mailto:person_c@test.com). However, everytime this happens, Person A will get copied in the email (in the email's CC) for some reason!! Is there a way to turn this off somehow?
- We'd like the email to be sent from a specific person (instead of the actual user who made the update). However, there is no way to set the sender in the SingleEmailMessage. Is there another way to do this? We are currently looking into doing an Email Service to achieve this, but was wondering if there is an easier way
Any help or suggestion will be appreciated.
Thanks,
Jeffrey
Hi Jeffrey,
Use setTargetObjectId(targetObjectId) method, and change your code accordingly, If possible you can share the code here, so that i will exactly let know where to make the changes
--
Thanks,
Swayam
@salesforceguy
NOTE: the email used below were changed to a test email.
I have created a case with Salesforce Support as well to see if they know of the reason.