From 91cc97fefbb9a1bb5517501270bd6468e17b287d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 21 Mar 2023 13:01:18 +1300 Subject: [PATCH] Remove preferred_mail_format from tokens This also removes the handling from action schedule - there might be a test checking it's presence to putting up to adapt tests --- CRM/Contact/Tokens.php | 1 - CRM/Core/BAO/ActionSchedule.php | 4 +--- tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php | 4 ---- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CRM/Contact/Tokens.php b/CRM/Contact/Tokens.php index 01c1e358a3..de25925709 100644 --- a/CRM/Contact/Tokens.php +++ b/CRM/Contact/Tokens.php @@ -156,7 +156,6 @@ class CRM_Contact_Tokens extends CRM_Core_EntityTokens { 'image_URL', 'preferred_communication_method', 'preferred_language', - 'preferred_mail_format', 'hash', 'source', 'first_name', diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index 3ff899d91c..c63492d147 100644 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -640,10 +640,8 @@ FROM civicrm_action_schedule cas $tp->addMessage('body_html', $schedule->body_html, 'text/html'); $tp->addMessage('sms_body_text', $schedule->sms_body_text, 'text/plain'); $tp->addMessage('subject', $schedule->subject, 'text/plain'); - // These 2 are not 'real' tokens - but it tells the processor to load them. + // These is not a 'real' token - but it tells the processor to load them. $tp->addMessage('toName', '{contact.display_name}', 'text/plain'); - $tp->addMessage('preferred_mail_format', '{contact.preferred_mail_format}', 'text/plain'); - return $tp; } diff --git a/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php b/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php index 0377bbd046..73a2650df0 100644 --- a/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php +++ b/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php @@ -691,7 +691,6 @@ emo '{contact.image_URL}' => 'Image Url', '{contact.preferred_communication_method:label}' => 'Preferred Communication Method', '{contact.preferred_language:label}' => 'Preferred Language', - '{contact.preferred_mail_format:label}' => 'Preferred Mail Format', '{contact.hash}' => 'Contact Hash', '{contact.source}' => 'Contact Source', '{contact.first_name}' => 'First Name', @@ -792,7 +791,6 @@ emo 'image_URL' => 'https://example.com', 'preferred_communication_method' => 'Phone', 'preferred_language' => 'fr_CA', - 'preferred_mail_format' => 'Both', 'hash' => 'xyz', 'contact_source' => 'Contact Source', 'first_name' => 'Robert', @@ -987,7 +985,6 @@ nick_name:Bob image_URL:https://example.com preferred_communication_method:Phone preferred_language:fr_CA -preferred_mail_format:Both hash:xyz contact_source:Contact Source first_name:Robert @@ -1087,7 +1084,6 @@ nick_name |Bob image_URL |https://example.com preferred_communication_method:label |Phone preferred_language:label |French (Canada) -preferred_mail_format:label |Both hash |xyz source |Contact Source first_name |Robert -- 2.25.1