Staff working on cases often send emails related to the case from the Manage Case page, or using Send Copy from the Activity form, or by having 'Email copy of activity to assignee' feature enabled. In each situation, if the recipient replies - we need the EmailProcessor script which handles filing of Inbound Emails (as activities) to be able to file the replies to the correct case.
1. Any emails generated from the above workflows (e.g. sent from within the CiviCase 'case context') should automatically prepend a hashed case id 'tag' to the email subject before sending:
[ Case ID: $hashedCaseID ] My Subject Text
2. EmailProcessor.php script (emailtoactivity mode)
Extend the activity create portion of this script to check for the above tag 'signature'. If found, evaluate the hashed Case ID.
- If matches a valid existing civicrm_case.id value, then we create the activity AND insert civicrm_case_activity record linking the activity to the case
- if evaluated case id does NOT match a valid civcrm_case.id record, report the error. We should still attempt to create the activity record w/o linking it to a case however.