Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.4.4
-
Fix Version/s: 3.4.6
-
Component/s: Core CiviCRM
-
Labels:None
Description
In multi-step workflows that involve reviews, it is useful to create an activity (such as "Review Applicant") with a target_contact and assignee_contact referring to different individuals (e.g. target_contact is an applicant, and assignee_contact is a staff member). To deal with late/overdue/uncompleted activities, one would configure an email reminder as follows:
- The email recipient ("To:") would be the assignee_contact (e.g. the staff-member who needs to perform the review)
- The email subject and body would reference the target_contact (e.g. the constituent for whom the review is needed)
e.g. The subject might be "Overdue: Review Application for {contact.display_name}" ("Overdue: Review Application for Joe Constituent")
e.g. The embedded form URL should specify the target's contact_id
In the current implementation, the
{contact.*} mail-merge tokens would be bound to the assignee_contact; consequently, a staff member would receive several undifferentiable emails referring to himself (e.g. "Overdue: Review Application for Jane Staffer").There are a few ways to deal with this:
1. Always bind the {contact.*}
mail-merge tokens to the first target_contact. (This, of course, creates an opposite bug: one could no longer pull in details about the assignee_contact. However, if you could only merge details for one contact, it would be more useful to have the assignee.)
2. Bind two sets of mail-merge tokens,
{target_contact.*}and
{assignee_contact.*}to remove any ambiguity.
3. Enable Smarty templating and expose sufficient information that
{crmAPI}(or similar) could be used to look-up details for both contacts.
We should probably do some mix of these options to support sites/users on both the CiviCRM mail-merge and the Smarty templating.
–
The attached patch is one idea for the Smarty approach. It allows email-authors to use codes like:
{simpleActivityContacts activity_id=$activity.activity_id assignee_var=assignee target_var=target}Dear {$assignee.display_name}, activity #{$activity.activity_id} is overdue, and {$target.display_name} will be very disappointed.