Stop using replaceContactTokens in core
As of a 6 months ago, or so, we had resolved all differences between using the token processor and replaceContactTokens to ....replaceContactTokens.
We don't quite have the api yet but when complete it is pretty much a drop in replacement for
$url = CRM_Core_BAO_MessageTemplate::renderTemplate([ 'messageTemplate' => ['msg_text' => $this->_postURL], 'contactId' => $this->_id, 'disableSmarty' => TRUE, ])['text'];
renderTemplate directly is supported provided
- it is only done from core and
- there is test cover for each instance
We don't have that many places left so I'm going to push through & replace them.
The last place in core is the token processor itself. I intend to cut that dependency last & duplicate the code in some way onto the processor.
While not supported from outside of core
replaceContactTokens IS called from a number of places. We are also firming up the new token api so I don't want to 'hustle' people to change their code until it's bedded in so I propose to deprecate quietly at this stage (
@deprecated on the function but don't make it 'noisy' for a few more months)