pass the mailing job id to hook token values
authorMichael McAndrew <michaelmcandrew@thirdsectordesign.org>
Tue, 24 Apr 2018 16:07:25 +0000 (17:07 +0100)
committerMichael McAndrew <michaelmcandrew@thirdsectordesign.org>
Tue, 24 Apr 2018 16:07:25 +0000 (17:07 +0100)
Civi/Token/TokenCompatSubscriber.php

index d00acd75092236e8466f963130f1b1304ee6ff02..8e2ac735ba1b176cb5216da295183ec7733282b9 100644 (file)
@@ -90,7 +90,7 @@ class TokenCompatSubscriber implements EventSubscriberInterface {
       // less randomly.
       \CRM_Utils_Hook::tokenValues($contactArray,
         (array) $contactId,
-        empty($row->context['mailingJob']) ? NULL : $row->context['mailingJob']->id,
+        empty($row->context['mailingJobId']) ? NULL : $row->context['mailingJobId'],
         $messageTokens,
         $row->context['controller']
       );