1

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?

1

You can ALMOST do it with 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 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.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.