When implementing hook_civicrm_tokenValues() for mailing jobs, the job ID can not be retrieved in TokenCompatSubscriber::onEvaluate(), as it is not being included within the context created by DefaultComposer::createTokenProcessorContext(). As a result, hook_civicrm_tokenValue() implementations have no clue about which job is requesting tokens.
Seems it would be enough to include 'mailingJob' => $e->getJob() in the returned context within DefaultComposer::createTokenProcessorContext().
When implementing
hook_civicrm_tokenValues()
for mailing jobs, the job ID can not be retrieved inTokenCompatSubscriber::onEvaluate()
, as it is not being included within the context created byDefaultComposer::createTokenProcessorContext()
. As a result,hook_civicrm_tokenValue()
implementations have no clue about which job is requesting tokens.Seems it would be enough to include
'mailingJob' => $e->getJob()
in the returned context withinDefaultComposer::createTokenProcessorContext()
.