Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CiviCRM Scheduled Reminders, Event custom fields are not available as tokens #20334

Closed
wants to merge 1 commit into from

Conversation

agileware-justin
Copy link
Contributor

Overview

CiviCRM Scheduled Reminders, Event custom fields are not available as tokens

Before

Event custom fields are NOT available as tokens in Scheduled Reminders

After

Event custom fields ARE available as tokens in Scheduled Reminders

Technical Details

Comments

Ping @mattwire

Agileware Ref: CIVICRM-1730

@civibot
Copy link

civibot bot commented May 18, 2021

(Standard links)

… available as tokens in Scheduled Reminders. Add implementation to TokenProcessor
'{event.registration_url}' => ts('Event Registration URL'),
'{event.balance}' => ts('Event Balance'),
];
static $tokens = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use Civi::$statics instead? I think this will eventually cause problem with tests.

For more information: https://civicrm.org/blog/totten/the-static-is-dead-long-live-the-static

@@ -1852,7 +1852,7 @@ public static function legacyContactTokens() {
*/
public static function getCustomFieldTokens($entity, $usedForTokenWidget = FALSE) {
$customTokens = [];
$tokenName = $usedForTokenWidget ? "{contribution.custom_%d}" : "custom_%d";
$tokenName = $usedForTokenWidget ? '{' . strtolower($entity) . '.custom_%d}' : 'custom_%d';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use mb_strtolower instead? It tends to be more reliable for when running CiviCRM in non-English (well, more specifically when running in Turkish, example: civicrm/civicrm-packages#324).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants