3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2014
32 * $Id: Display.php 36505 2011-10-03 14:19:56Z lobo $
37 * This class generates form components for the component preferences
40 class CRM_Admin_Form_Preferences_Mailing
extends CRM_Admin_Form_Preferences
{
41 public function preProcess() {
42 CRM_Utils_System
::setTitle(ts('CiviMail Component Settings'));
43 $this->_varNames
= array(
44 CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
=> array(
45 'profile_double_optin' => array(
46 'html_type' => 'checkbox',
47 'title' => ts('Enable Double Opt-in for Profile Group(s) field'),
49 'description' => ts('When CiviMail is enabled, users who "subscribe" to a group from a profile Group(s) checkbox will receive a confirmation email. They must respond (opt-in) before they are added to the group.'),
51 'profile_add_to_group_double_optin' => array(
52 'html_type' => 'checkbox',
53 'title' => ts('Enable Double Opt-in for Profiles which use the "Add to Group" setting'),
55 'description' => ts('When CiviMail is enabled and a profile uses the "Add to Group" setting, users who complete the profile form will receive a confirmation email. They must respond (opt-in) before they are added to the group.'),
57 'track_civimail_replies' => array(
58 'html_type' => 'checkbox',
59 'title' => ts('Track replies using VERP in Reply-To header'),
61 'description' => ts('If checked, mailings will default to tracking replies using VERP-ed Reply-To.'),
63 'civimail_workflow' => array(
64 'html_type' => 'checkbox',
65 'title' => ts('Enable workflow support for CiviMail'),
67 'description' => ts('Drupal-only. Rules module must be enabled (beta feature - use with caution).'),
69 'civimail_multiple_bulk_emails' => array(
70 'html_type' => 'checkbox',
71 'title' => ts('Enable multiple bulk email address for a contact.'),
73 'description' => ts('CiviMail will deliver a copy of the email to each bulk email listed for the contact.'),
75 'civimail_server_wide_lock' => array(
76 'html_type' => 'checkbox',
77 'title' => ts('Enable global server wide lock for CiviMail'),
79 'description' => NULL,
81 'include_message_id' => array(
82 'html_type' => 'checkbox',
83 'title' => ts('Enable CiviMail to generate Message-ID header'),
85 'description' => NULL,
87 'write_activity_record' => array(
88 'html_type' => 'checkbox',
89 'title' => ts('Enable CiviMail to create activities on delivery'),
91 'description' => NULL,
93 'disable_mandatory_tokens_check' => array(
94 'html_type' => 'checkbox',
95 'title' => ts('Disable check for mandatory tokens'),
97 '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.'),
99 'dedupe_email_default' => array(
100 'html_type' => 'checkbox',
101 'title' => ts('CiviMail dedupes e-mail addresses by default'),
103 'description' => NULL,
105 'hash_mailing_url' => array(
106 'html_type' => 'checkbox',
107 'title' => ts('Hashed Mailing URL\'s'),
109 'description' => 'If enabled, a randomized hash key will be used to reference the mailing URL in the mailing.viewUrl token, instead of the mailing ID',
114 parent
::preProcess();
117 public function postProcess() {
118 // check if mailing tab is enabled, if not prompt user to enable the tab if "write_activity_record" is disabled
119 $params = $this->controller
->exportValues($this->_name
);
121 if (empty($params['write_activity_record'])) {
122 $existingViewOptions = CRM_Core_BAO_Setting
::getItem(
123 CRM_Core_BAO_Setting
::SYSTEM_PREFERENCES_NAME
,
124 'contact_view_options'
127 $displayValue = CRM_Core_OptionGroup
::getValue('contact_view_options', 'CiviMail', 'name');
128 $viewOptions = explode(CRM_Core_DAO
::VALUE_SEPARATOR
, $existingViewOptions);
130 if (!in_array($displayValue, $viewOptions)) {
131 $existingViewOptions .= $displayValue . CRM_Core_DAO
::VALUE_SEPARATOR
;
133 CRM_Core_BAO_Setting
::setItem($existingViewOptions, CRM_Core_BAO_Setting
::SYSTEM_PREFERENCES_NAME
, 'contact_view_options');
134 CRM_Core_Session
::setStatus(ts('We have automatically enabled the Mailings tab for the Contact Summary screens
135 so that you can view mailings sent to each contact.'), ts('Saved'), 'success');
139 parent
::postProcess();