civicrm / org.civicrm.flexmailer

FlexMailer is now part of civicrm-core. Please see the link below for how to upgrade.
https://civicrm.org/extensions/flexmailer
Other
5 stars 22 forks source link

Mailing job ID can not be retrieved for hook_civicrm_tokenValues() implementations #17

Closed jensschuppe closed 6 years ago

jensschuppe commented 6 years ago

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().

jensschuppe commented 6 years ago

PR in #18