pass the mailing job id to hook token values
[civicrm-core.git] / 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']
       );