I have a custom object named 'Host'. When they are BCC'd in an email, I want to log that in the Host's Activity History.

I'm a bit lost on where to get started on this. It seems as if there was a trigger that was 'after Email' where I could somehow add the email to the Host's Activity History would be the most ideal - but I don't think this exists.

Any suggestions?


More Info:

When you go to the 'Contact' Objects in salesforce, and select a contact, you are able to send them an email. You do this by hovering over the 'Active History' button and selecting 'Send Email'.

In the form that follows, there is a section marked BCC where you can send a copy of the email to other email addresses. If an email specified in the BCC field matches an Email attached to my custom 'Host' object, I want to log the email in that 'Host' Active History

  • Do you mean BCC? Who is "they"? Can you please give us a lot of detail? Commented Jul 18, 2017 at 21:45
  • Added more info, Hope that clears up any confusion Commented Jul 18, 2017 at 22:02
  • what do you mean by email attached to Host__c? If bcc email on an email sent from a Contact matches any child email (as to: ? cc: ? bcc:? )under Host__c, create a new activity under Host__c?
    – cropredy
    Commented Jul 18, 2017 at 22:09
  • @cropredy I have a field in my 'Host' Object for Emails: Host__c.Email__c - when an email is sent with a bbc that matches a Host__c.Email__c I want to log it in the Activity History for that host Commented Jul 18, 2017 at 22:13
  • this is going to take a trigger on EmailMessage -- do some research and come back to us after you've explored this
    – cropredy
    Commented Jul 18, 2017 at 22:16

1 Answer 1


@cropredy was right, I needed to use a trigger on EmailMessage. Unfortunately, Salesforce doesn't allow you to tie the email directly to a Custom Object(https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_emailmessagerelation.htm)

Thus, I had to create a Completed task on my custom host and log the details of the email in the comments.

It's not ideal, but it works

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .