CRM-16237 - crmMailing - Respect disable_mandatory_tokens_check
authorTim Otten <totten@civicrm.org>
Tue, 7 Apr 2015 21:28:24 +0000 (14:28 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 7 Apr 2015 21:28:24 +0000 (14:28 -0700)
CRM/Mailing/Info.php
js/angular-crmMailing/services.js

index 56a9cfe6b47eee67f7fc2f39eec1401be879818f..bad9cd7a852ffd6406f0e7d2daebbb76645b8ee2 100644 (file)
@@ -158,6 +158,7 @@ class CRM_Mailing_Info extends CRM_Core_Component_Info {
           'contactid' => $contactID,
           'requiredTokens' => CRM_Utils_Token::getRequiredTokens(),
           'enableReplyTo' => (int) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'replyTo'),
+          'disableMandatoryTokensCheck' => (int) CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'disable_mandatory_tokens_check'),
           'fromAddress' => $fromAddress['values'],
           'defaultTestEmail' => civicrm_api3('Contact', 'getvalue', array(
               'id' => 'user_contact_id',
index b9a46965a352da3cb8c1eecf0dfd40ba28884ef0..f6ea4f707a346c5143d35af6709880e646aa0121 100644 (file)
       // ex: var msgs = findMissingTokens(mailing, 'body_html');
       findMissingTokens: function(mailing, field) {
         var missing = {};
-        if (!_.isEmpty(mailing[field])) {
+        if (!_.isEmpty(mailing[field]) && !CRM.crmMailing.disableMandatoryTokensCheck) {
           var body = '';
           if (mailing.footer_id) {
             var footer = _.where(CRM.crmMailing.headerfooterList, {id: mailing.footer_id});