I have created a custom Drupal 8/9 module that defines hook_civicrm_tokens and hook_civicrm_tokenValues to provide tokens to CiviCRM.

It works when not using mosaico, but fails (the tokens are evaluated to "empty") without any noticeable error when using the same token with mosaico.

Any hints on debugging this?

It seemed like it could be a flexmailer issue instead and I tried the flexmailer "CiviMail BAO" setting instead, but that didn't seem to have any effect.

I also tried upgrading to civicrm to 5.42.0, but no joy there either.

  • Don't know but there have been lots of internal changes affecting tokens recently. What namespace are they in - a custom one or your own? There were some issues creating your own tokens in the standard namespaces - eg {contact.mything}
    – Aidan
    Oct 14 at 13:22
  • They have a custom "namespace" (not really a namespace, but I know what you mean ...).
    – Alan Dixon
    Oct 15 at 20:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.