From 9d76357ab4d4753520911e244dd208f875ad2ced Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Thu, 13 Feb 2014 13:21:11 -0800 Subject: [PATCH] CRM-14193 - Add CiviMail component setting to control Dedupe Mailings option. This PR replaces PR 2497 which had fatal syntax error (missing comma) in Mailing.setting.php ---------------------------------------- * CRM-14193: Add option to default Civimail "dedupe e-mail" setting to true http://issues.civicrm.org/jira/browse/CRM-14193 --- CRM/Admin/Form/Preferences/Mailing.php | 7 +++++++ CRM/Mailing/Form/Group.php | 4 ++++ settings/Mailing.setting.php | 16 +++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/Preferences/Mailing.php b/CRM/Admin/Form/Preferences/Mailing.php index cb98e4b035..c979bc6dd5 100644 --- a/CRM/Admin/Form/Preferences/Mailing.php +++ b/CRM/Admin/Form/Preferences/Mailing.php @@ -106,6 +106,13 @@ class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences { 'weight' => 9, 'description' => ts('Don\'t check for presence of mandatory tokens (domain address; unsubscribe/opt-out) before sending mailings. WARNING: Mandatory tokens are a safe-guard which facilitate compliance with the US CAN-SPAM Act. They should only be disabled if your organization adopts other mechanisms for compliance or if your organization is not subject to CAN-SPAM.'), ), + 'dedupe_email_default' => + array( + 'html_type' => 'checkbox', + 'title' => ts('CiviMail dedupes e-mail addresses by default'), + 'weight' => 10, + 'description' => NULL, + ), ), ); diff --git a/CRM/Mailing/Form/Group.php b/CRM/Mailing/Form/Group.php index 788ee89e32..e653fa6ff8 100644 --- a/CRM/Mailing/Form/Group.php +++ b/CRM/Mailing/Form/Group.php @@ -100,6 +100,10 @@ class CRM_Mailing_Form_Group extends CRM_Contact_Form_Task { $continue = CRM_Utils_Request::retrieve('continue', 'String', $this, FALSE, NULL); $defaults = array(); + $defaults['dedupe_email'] = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, + 'dedupe_email_default', NULL, FALSE + ); + if ($this->_mailingID) { // check that the user has permission to access mailing id CRM_Mailing_BAO_Mailing::checkPermission($this->_mailingID); diff --git a/settings/Mailing.setting.php b/settings/Mailing.setting.php index 31b6c02d60..2e4d0238c1 100644 --- a/settings/Mailing.setting.php +++ b/settings/Mailing.setting.php @@ -149,5 +149,19 @@ return array( 'is_contact' => 0, 'description' => 'Don\'t check for presence of mandatory tokens (domain address; unsubscribe/opt-out) before sending mailings. WARNING: Mandatory tokens are a safe-guard which facilitate compliance with the US CAN-SPAM Act. They should only be disabled if your organization adopts other mechanisms for compliance or if your organization is not subject to CAN-SPAM.', 'help_text' => null, + ), + 'dedupe_email_default' => array( + 'group_name' => 'Mailing Preferences', + 'group' => 'mailing', + 'name' => 'dedupe_email_default', + 'type' => 'Integer', + 'html_type' => 'checkbox', + 'default' => 1, + 'add' => '4.5', + 'title' => 'CiviMail dedupes e-mail addresses by default', + 'is_domain' => 1, + 'is_contact' => 0, + 'description' => 'Set the "dedupe e-mail" option when sending a new mailing to "true" by default.', + 'help_text' => null, ), - ); +); -- 2.25.1