Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-11176

Bug related to checking if tokens are used or not

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 4.2.4
    • Fix Version/s: 4.3.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      In the file CRM/Activity/BAO/Activity.php the function "sendEmail" does some checking to determine if tokens are in use or not. But it only checks for the use of core mail tokens, such as "contact.first_name" . So if in email is using only custom mail merge tokens defined by a hook, then none of those tokens get filled in.

      To fix the problem I changed the code around line 1334:
      Original section:
      if (!empty($returnProperties))

      { list($details) = CRM_Utils_Token::getTokenDetails($contactIds, $returnProperties, NULL, NULL, FALSE, $messageToken, 'CRM_Activity_BAO_Activity' ); }

      New section of code, working:

      // if (!empty($returnProperties))

      { list($details) = CRM_Utils_Token::getTokenDetails($contactIds, $returnProperties, NULL, NULL, FALSE, $messageToken, 'CRM_Activity_BAO_Activity' ); // }

      This solution assumes tokens are always in use. I am not sure of any side-affects of this fix.

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              sgladstone Sarah Gladstone
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: