CiviCRM extension: Provides tokens for any related contact, for all available contact tokens. E.g., to get the spouse's first name, or parent's marriage date.
Other
1
stars
5
forks
source link
handle both Activity Email and CiviMail-style token arrays #9
At first I thought this was a bug in your extension - but it's really a bug in core. Given how long the bug has been in core (2016) I think it makes sense to account for it in the extension - especially since this fix won't need changing if the bug ever IS fixed.
Chris Burgess outlines the issue perfectly in CRM-19758 - essentially, the array passed to this hook as $tokens isn't always in the same format. As a result, the tokens this extension generates fail on CiviMail (but not quick email, scheduled reminders, etc.)
At first I thought this was a bug in your extension - but it's really a bug in core. Given how long the bug has been in core (2016) I think it makes sense to account for it in the extension - especially since this fix won't need changing if the bug ever IS fixed.
Chris Burgess outlines the issue perfectly in CRM-19758 - essentially, the array passed to this hook as
$tokens
isn't always in the same format. As a result, the tokens this extension generates fail on CiviMail (but not quick email, scheduled reminders, etc.)This adds a helper function (stolen from Chris Burgess) to account for both array formats.
To test: Create a template with this text: