3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.5 |
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 function preProcess() {
42 CRM_Utils_System
::setTitle(ts('CiviMail Component Settings'));
43 $this->_varNames
= array(
44 CRM_Core_BAO_Setting
::MAILING_PREFERENCES_NAME
=>
46 'profile_double_optin' =>
48 'html_type' => 'checkbox',
49 'title' => ts('Enable Double Opt-in for Profile Group(s) field'),
51 '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.'),
53 'profile_add_to_group_double_optin' =>
55 'html_type' => 'checkbox',
56 'title' => ts('Enable Double Opt-in for Profiles which use the "Add to Group" setting'),
58 '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.'),
60 'track_civimail_replies' =>
62 'html_type' => 'checkbox',
63 'title' => ts('Track replies using VERP in Reply-To header'),
65 'description' => ts('If checked, mailings will default to tracking replies using VERP-ed Reply-To.'),
67 'civimail_workflow' =>
69 'html_type' => 'checkbox',
70 'title' => ts('Enable workflow support for CiviMail'),
72 'description' => ts('Drupal-only. Rules module must be enabled (beta feature - use with caution).'),
74 'civimail_multiple_bulk_emails' =>
76 'html_type' => 'checkbox',
77 'title' => ts('Enable multiple bulk email address for a contact.'),
79 'description' => ts('CiviMail will deliver a copy of the email to each bulk email listed for the contact.'),
81 'civimail_server_wide_lock' =>
83 'html_type' => 'checkbox',
84 'title' => ts('Enable global server wide lock for CiviMail'),
86 'description' => NULL,
88 'include_message_id' =>
90 'html_type' => 'checkbox',
91 'title' => ts('Enable CiviMail to generate Message-ID header'),
93 'description' => NULL,
95 'write_activity_record' =>
97 'html_type' => 'checkbox',
98 'title' => ts('Enable CiviMail to create activities on delivery'),
100 'description' => NULL,
102 'disable_mandatory_tokens_check' =>
104 'html_type' => 'checkbox',
105 'title' => ts('Disable check for mandatory tokens'),
107 '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.'),
109 'dedupe_email_default' =>
111 'html_type' => 'checkbox',
112 'title' => ts('CiviMail dedupes e-mail addresses by default'),
114 'description' => NULL,
116 'hash_mailing_url' =>
118 'html_type' => 'checkbox',
119 'title' => ts('Hashed Mailing URL\'s'),
121 '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',
126 parent
::preProcess();
129 function postProcess() {
130 // check if mailing tab is enabled, if not prompt user to enable the tab if "write_activity_record" is disabled
131 $params = $this->controller
->exportValues($this->_name
);
133 if (empty($params['write_activity_record'])) {
134 $existingViewOptions = CRM_Core_BAO_Setting
::getItem(
135 CRM_Core_BAO_Setting
::SYSTEM_PREFERENCES_NAME
,
136 'contact_view_options'
139 $displayValue = CRM_Core_OptionGroup
::getValue('contact_view_options', 'CiviMail', 'name');
140 $viewOptions = explode(CRM_Core_DAO
::VALUE_SEPARATOR
, $existingViewOptions);
142 if (!in_array($displayValue, $viewOptions)) {
143 $existingViewOptions .= $displayValue . CRM_Core_DAO
::VALUE_SEPARATOR
;
145 CRM_Core_BAO_Setting
::setItem($existingViewOptions, CRM_Core_BAO_Setting
::SYSTEM_PREFERENCES_NAME
, 'contact_view_options');
146 CRM_Core_Session
::setStatus(ts('We have automatically enabled the Mailings tab for the Contact Summary screens
147 so that you can view mailings sent to each contact.'), ts('Saved'), 'success');
151 parent
::postProcess();