Custom tokens not working in CiviMail
Overview
Custom tokens are not evaluated during CiviMail mailings.
Reproduction steps
- Add example code from Defining tokens documentation to define two custom tokens:
{profile.viewUrl}
and{profile.viewLink}
. Cleanup caches. - Create a CiviMail mailing and insert the new tokens then submit the mailing.
Current behaviour
Resulting email sent by the background mailing job does not include either of the custom tokens. Emails containing the custom tokens are evaluated properly when sent as a CiviMail test or via a send email action for a contact.
Expected behaviour
CiviMail mailings must evaluate custom tokens.
Environment information
- CiviCRM: 5.58.0
- PHP: 7.4
- CMS: Both WordPress 6.1.1 and Drupal 7.94
- Database: MySQL 5.7
- Web Server: Apache