Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
fee14197 | 4 | | CiviCRM version 5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
8c9251b3 | 6 | | Copyright CiviCRM LLC (c) 2004-2018 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
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. | | |
13 | | | | |
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. | | |
18 | | | | |
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 | +--------------------------------------------------------------------+ | |
d25dd0ee | 26 | */ |
6a488035 TO |
27 | |
28 | /** | |
29 | * | |
30 | * @package CRM | |
8c9251b3 | 31 | * @copyright CiviCRM LLC (c) 2004-2018 |
6a488035 TO |
32 | * $Id: Display.php 36505 2011-10-03 14:19:56Z lobo $ |
33 | * | |
34 | */ | |
35 | ||
36 | /** | |
37 | * This class generates form components for the component preferences | |
38 | * | |
39 | */ | |
40 | class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences { | |
00be9182 | 41 | public function preProcess() { |
6a488035 TO |
42 | CRM_Utils_System::setTitle(ts('CiviMail Component Settings')); |
43 | $this->_varNames = array( | |
9d72cede EM |
44 | CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME => array( |
45 | 'profile_double_optin' => array( | |
6a488035 TO |
46 | 'html_type' => 'checkbox', |
47 | 'title' => ts('Enable Double Opt-in for Profile Group(s) field'), | |
48 | 'weight' => 1, | |
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.'), | |
50 | ), | |
9d72cede | 51 | 'profile_add_to_group_double_optin' => array( |
6a488035 TO |
52 | 'html_type' => 'checkbox', |
53 | 'title' => ts('Enable Double Opt-in for Profiles which use the "Add to Group" setting'), | |
54 | 'weight' => 2, | |
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.'), | |
56 | ), | |
9d72cede | 57 | 'track_civimail_replies' => array( |
6a488035 TO |
58 | 'html_type' => 'checkbox', |
59 | 'title' => ts('Track replies using VERP in Reply-To header'), | |
60 | 'weight' => 3, | |
61 | 'description' => ts('If checked, mailings will default to tracking replies using VERP-ed Reply-To.'), | |
62 | ), | |
9d72cede | 63 | 'civimail_workflow' => array( |
6a488035 TO |
64 | 'html_type' => 'checkbox', |
65 | 'title' => ts('Enable workflow support for CiviMail'), | |
66 | 'weight' => 4, | |
67 | 'description' => ts('Drupal-only. Rules module must be enabled (beta feature - use with caution).'), | |
68 | ), | |
9d72cede | 69 | 'civimail_multiple_bulk_emails' => array( |
6a488035 TO |
70 | 'html_type' => 'checkbox', |
71 | 'title' => ts('Enable multiple bulk email address for a contact.'), | |
72 | 'weight' => 5, | |
73 | 'description' => ts('CiviMail will deliver a copy of the email to each bulk email listed for the contact.'), | |
74 | ), | |
9d72cede | 75 | 'civimail_server_wide_lock' => array( |
6a488035 TO |
76 | 'html_type' => 'checkbox', |
77 | 'title' => ts('Enable global server wide lock for CiviMail'), | |
78 | 'weight' => 6, | |
79 | 'description' => NULL, | |
80 | ), | |
9d72cede | 81 | 'include_message_id' => array( |
6a488035 TO |
82 | 'html_type' => 'checkbox', |
83 | 'title' => ts('Enable CiviMail to generate Message-ID header'), | |
84 | 'weight' => 7, | |
85 | 'description' => NULL, | |
86 | ), | |
9d72cede | 87 | 'write_activity_record' => array( |
2ede60ec DL |
88 | 'html_type' => 'checkbox', |
89 | 'title' => ts('Enable CiviMail to create activities on delivery'), | |
90 | 'weight' => 8, | |
91 | 'description' => NULL, | |
92 | ), | |
9d72cede | 93 | 'disable_mandatory_tokens_check' => array( |
9babb598 OB |
94 | 'html_type' => 'checkbox', |
95 | 'title' => ts('Disable check for mandatory tokens'), | |
96 | 'weight' => 9, | |
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.'), | |
98 | ), | |
9d72cede | 99 | 'dedupe_email_default' => array( |
9d76357a DG |
100 | 'html_type' => 'checkbox', |
101 | 'title' => ts('CiviMail dedupes e-mail addresses by default'), | |
102 | 'weight' => 10, | |
103 | 'description' => NULL, | |
104 | ), | |
9d72cede | 105 | 'hash_mailing_url' => array( |
c57f36a1 PJ |
106 | 'html_type' => 'checkbox', |
107 | 'title' => ts('Hashed Mailing URL\'s'), | |
108 | 'weight' => 11, | |
44f6941d | 109 | 'description' => ts('If enabled, a randomized hash key will be used to reference the mailing URL in the mailing.viewUrl token, instead of the mailing ID'), |
c57f36a1 | 110 | ), |
05752ee5 | 111 | 'auto_recipient_rebuild' => array( |
112 | 'html_type' => 'checkbox', | |
113 | 'title' => ts('Enable automatic CiviMail recipient count display'), | |
114 | 'weight' => 12, | |
44f6941d | 115 | 'description' => ts('Enable this setting to rebuild recipient list automatically during composing mail. Disable will allow you to rebuild recipient manually.'), |
05752ee5 | 116 | ), |
6a488035 TO |
117 | ), |
118 | ); | |
119 | ||
120 | parent::preProcess(); | |
121 | } | |
5c61cec2 | 122 | |
00be9182 | 123 | public function postProcess() { |
5c61cec2 KJ |
124 | // check if mailing tab is enabled, if not prompt user to enable the tab if "write_activity_record" is disabled |
125 | $params = $this->controller->exportValues($this->_name); | |
126 | ||
a7488080 | 127 | if (empty($params['write_activity_record'])) { |
aaffa79f | 128 | $existingViewOptions = Civi::settings()->get('contact_view_options'); |
5c61cec2 KJ |
129 | |
130 | $displayValue = CRM_Core_OptionGroup::getValue('contact_view_options', 'CiviMail', 'name'); | |
131 | $viewOptions = explode(CRM_Core_DAO::VALUE_SEPARATOR, $existingViewOptions); | |
132 | ||
133 | if (!in_array($displayValue, $viewOptions)) { | |
134 | $existingViewOptions .= $displayValue . CRM_Core_DAO::VALUE_SEPARATOR; | |
135 | ||
08ef4ddd | 136 | Civi::settings()->set('contact_view_options', $existingViewOptions); |
5c61cec2 KJ |
137 | CRM_Core_Session::setStatus(ts('We have automatically enabled the Mailings tab for the Contact Summary screens |
138 | so that you can view mailings sent to each contact.'), ts('Saved'), 'success'); | |
139 | } | |
140 | } | |
141 | ||
142 | parent::postProcess(); | |
143 | } | |
96025800 | 144 | |
9d72cede | 145 | } |