Answers.Body: <p>You can ALMOST do it with <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_emailProcessorContact/" rel="nofollow noreferrer">hook_civicrm_emailProcessorContact</a>, but you don't know at that point which ones are cc's.</p>
  <p>But you might be able to do it with <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_emailProcessor/" rel="nofollow noreferrer">hook_civicrm_emailProcessor</a> because there you know which are cc's, except you only have their email not the contact_id. So I admit this is awkward but you could do something like:</p>
  <ol>
  <li>For each of the cc's, look up the contact id from the email address the same way the email processor does - <code>CRM_Contact_BAO_Contact::matchContactOnEmail($email, 'Individual')-&gt;contact_id</code></li>
  <li>The activity_id should be in the $result param in the hook.</li>
  <li>Delete the corresponding entry in civicrm_activity_contact. (If they were listed both as a To and a Cc you might need to get a little fancier.)</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-18T14:52:24.037Z
Answers.LastActivityDate: 2020-11-18T14:52:24.037Z
Answers.UserDisplayName: Demerit
Body: <p>Autofiling inbound emails as activities via EmailProcessor is a really nice feature. However for some CivCRM users it would be nice to have (always and system-wide) only filed activities for the FROM and TO contacts. Is there a way have CC addresses ignored?</p>
  
Tags: <email><activities>
Title: Email-to-activity processing: how to ignore cc
ThreadText: # Email-to-activity processing: how to ignore cc
  
  (Asked by: username_0 on 2020-11-18)
  
  Autofiling inbound emails as activities via EmailProcessor is a really nice feature. However for some CivCRM users it would be nice to have (always and system-wide) only filed activities for the FROM and TO contacts. Is there a way have CC addresses ignored?
  
  **Tags:** email, activities
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-11-18. Score: 1
  
  You can ALMOST do it with [hook\_civicrm\_emailProcessorContact](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_emailProcessorContact/), but you don't know at that point which ones are cc's.
  
  But you might be able to do it with [hook\_civicrm\_emailProcessor](https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_emailProcessor/) because there you know which are cc's, except you only have their email not the contact\_id. So I admit this is awkward but you could do something like:
  
  1. For each of the cc's, look up the contact id from the email address the same way the email processor does - `CRM_Contact_BAO_Contact::matchContactOnEmail($email, 'Individual')->contact_id`
  2. The activity\_id should be in the $result param in the hook.
  3. Delete the corresponding entry in civicrm\_activity\_contact. (If they were listed both as a To and a Cc you might need to get a little fancier.)
  
  
  ---
  
  