From b845ba462e33f018e20938de5c310a72ca42673f Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 24 Nov 2017 17:24:05 -0800 Subject: [PATCH] CRM-21472 - Allow FlexMailer to overload getRequiredTokens() - Comments --- CRM/Mailing/Info.php | 1 + CRM/Utils/Token.php | 1 + 2 files changed, 2 insertions(+) diff --git a/CRM/Mailing/Info.php b/CRM/Mailing/Info.php index c7820ea91c..6494010931 100644 --- a/CRM/Mailing/Info.php +++ b/CRM/Mailing/Info.php @@ -129,6 +129,7 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info { )); $enabledLanguages = CRM_Core_I18n::languages(TRUE); $isMultiLingual = (count($enabledLanguages) > 1); + // FlexMailer is a refactoring of CiviMail which provides new hooks/APIs/docs. If the sysadmin has opted to enable it, then use that instead of CiviMail. $requiredTokens = defined('CIVICRM_FLEXMAILER_HACK_REQUIRED_TOKENS') ? Civi\Core\Resolver::singleton()->call(CIVICRM_FLEXMAILER_HACK_REQUIRED_TOKENS, array()) : CRM_Utils_Token::getRequiredTokens(); CRM_Core_Resources::singleton() ->addSetting(array( diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index e58c3b6ce7..5b5b358c4f 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -118,6 +118,7 @@ class CRM_Utils_Token { * else an array of the missing tokens */ public static function requiredTokens(&$str) { + // FlexMailer is a refactoring of CiviMail which provides new hooks/APIs/docs. If the sysadmin has opted to enable it, then use that instead of CiviMail. $requiredTokens = defined('CIVICRM_FLEXMAILER_HACK_REQUIRED_TOKENS') ? Civi\Core\Resolver::singleton()->call(CIVICRM_FLEXMAILER_HACK_REQUIRED_TOKENS, array()) : CRM_Utils_Token::getRequiredTokens(); $missing = array(); -- 2.25.1