From b4a1fd0dce81b92650b8c08808b338d04bcaea6b Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 1 Aug 2022 06:57:19 +1000 Subject: [PATCH] Add token for CiviCRM empowered by image --- CRM/Core/DomainTokens.php | 2 ++ tests/phpunit/CRM/Utils/TokenConsistencyTest.php | 1 + .../message_templates/contribution_invoice_receipt_html.tpl | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Core/DomainTokens.php b/CRM/Core/DomainTokens.php index d28f1862c7..a7d6999c77 100644 --- a/CRM/Core/DomainTokens.php +++ b/CRM/Core/DomainTokens.php @@ -58,6 +58,7 @@ class CRM_Core_DomainTokens extends AbstractTokenSubscriber { 'now' => ts('Current time/date'), 'base_url' => ts('Domain absolute base url'), 'tax_term' => ts('Sales tax term (e.g VAT)'), + 'empowered_by_civicrm_image_url' => ts('Empowered By CiviCRM Image'), ]; } @@ -127,6 +128,7 @@ class CRM_Core_DomainTokens extends AbstractTokenSubscriber { $tokens['phone'] = $phone['phone'] ?? ''; $tokens['email'] = $email['email'] ?? ''; $tokens['base_url'] = Civi::paths()->getVariable('cms.root', 'url'); + $tokens['empowered_by_civicrm_image_url'] = CRM_Core_Config::singleton()->userFrameworkResourceURL . 'i/civi99.png'; $tokens['tax_term'] = (string) Civi::settings()->get('tax_term'); Civi::cache('metadata')->set($cacheKey, $tokens); } diff --git a/tests/phpunit/CRM/Utils/TokenConsistencyTest.php b/tests/phpunit/CRM/Utils/TokenConsistencyTest.php index ef491e0656..31b4544542 100644 --- a/tests/phpunit/CRM/Utils/TokenConsistencyTest.php +++ b/tests/phpunit/CRM/Utils/TokenConsistencyTest.php @@ -808,6 +808,7 @@ United States', $tokenProcessor->getRow(0)->render('message')); '{domain.postal_code}' => 'Domain (Organization) Postal Code', '{domain.state_province_id:label}' => 'Domain (Organization) State', '{domain.country_id:label}' => 'Domain (Organization) Country', + '{domain.empowered_by_civicrm_image_url}' => 'Empowered By CiviCRM Image', ]; } diff --git a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl index 5e6ddd2920..2425f9206e 100644 --- a/xml/templates/message_templates/contribution_invoice_receipt_html.tpl +++ b/xml/templates/message_templates/contribution_invoice_receipt_html.tpl @@ -9,7 +9,7 @@ {if $config->empoweredBy} - +
{/if} -- 2.25.1