CRM-21472 - Allow FlexMailer to overload getRequiredTokens() - Comments
authorTim Otten <totten@civicrm.org>
Sat, 25 Nov 2017 01:24:05 +0000 (17:24 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 25 Nov 2017 01:24:21 +0000 (17:24 -0800)
CRM/Mailing/Info.php
CRM/Utils/Token.php

index c7820ea91cd98248c581e174749c0163466c0058..6494010931801853cfd3bebf7d1844ab8f3f6c7b 100644 (file)
@@ -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(
index e58c3b6ce74a8534dba568d8c567a7c2c9a6e8d2..5b5b358c4f38909ed97766006d4a54f78c7db8ba 100644 (file)
@@ -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();