Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Mailing/Mailing.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
449c4e6b | 9 | * (GenCodeChecksum:f1550e9f33a11dda97195455557f3035) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Mailing entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
fa45b5b9 | 22 | public static $_tableName = 'civicrm_mailing'; |
c3fc2621 | 23 | |
449c4e6b CW |
24 | /** |
25 | * Icon associated with this entity. | |
26 | * | |
27 | * @var string | |
28 | */ | |
29 | public static $_icon = 'fa-envelope-o'; | |
30 | ||
e501603b | 31 | /** |
f41f0342 | 32 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 33 | * |
c3fc2621 | 34 | * @var bool |
e501603b | 35 | */ |
fa45b5b9 | 36 | public static $_log = FALSE; |
c3fc2621 | 37 | |
e501603b | 38 | /** |
e6ca0a57 | 39 | * @var int |
e501603b TO |
40 | */ |
41 | public $id; | |
c3fc2621 | 42 | |
e501603b TO |
43 | /** |
44 | * Which site is this mailing for | |
45 | * | |
e6ca0a57 | 46 | * @var int |
e501603b TO |
47 | */ |
48 | public $domain_id; | |
c3fc2621 | 49 | |
e501603b TO |
50 | /** |
51 | * FK to the header component. | |
52 | * | |
e6ca0a57 | 53 | * @var int |
e501603b TO |
54 | */ |
55 | public $header_id; | |
c3fc2621 | 56 | |
e501603b TO |
57 | /** |
58 | * FK to the footer component. | |
59 | * | |
e6ca0a57 | 60 | * @var int |
e501603b TO |
61 | */ |
62 | public $footer_id; | |
c3fc2621 | 63 | |
e501603b TO |
64 | /** |
65 | * FK to the auto-responder component. | |
66 | * | |
e6ca0a57 | 67 | * @var int |
e501603b TO |
68 | */ |
69 | public $reply_id; | |
c3fc2621 | 70 | |
e501603b TO |
71 | /** |
72 | * FK to the unsubscribe component. | |
73 | * | |
e6ca0a57 | 74 | * @var int |
e501603b TO |
75 | */ |
76 | public $unsubscribe_id; | |
c3fc2621 | 77 | |
e501603b | 78 | /** |
e6ca0a57 | 79 | * @var int |
e501603b TO |
80 | */ |
81 | public $resubscribe_id; | |
c3fc2621 | 82 | |
e501603b TO |
83 | /** |
84 | * FK to the opt-out component. | |
85 | * | |
e6ca0a57 | 86 | * @var int |
e501603b TO |
87 | */ |
88 | public $optout_id; | |
c3fc2621 | 89 | |
e501603b TO |
90 | /** |
91 | * Mailing Name. | |
92 | * | |
93 | * @var string | |
94 | */ | |
95 | public $name; | |
c3fc2621 | 96 | |
e501603b TO |
97 | /** |
98 | * differentiate between standalone mailings, A/B tests, and A/B final-winner | |
99 | * | |
100 | * @var string | |
101 | */ | |
102 | public $mailing_type; | |
c3fc2621 | 103 | |
e501603b TO |
104 | /** |
105 | * From Header of mailing | |
106 | * | |
107 | * @var string | |
108 | */ | |
109 | public $from_name; | |
c3fc2621 | 110 | |
e501603b TO |
111 | /** |
112 | * From Email of mailing | |
113 | * | |
114 | * @var string | |
115 | */ | |
116 | public $from_email; | |
c3fc2621 | 117 | |
e501603b TO |
118 | /** |
119 | * Reply-To Email of mailing | |
120 | * | |
121 | * @var string | |
122 | */ | |
123 | public $replyto_email; | |
c3fc2621 | 124 | |
703875d8 TO |
125 | /** |
126 | * The language/processing system used for email templates. | |
127 | * | |
128 | * @var string | |
129 | */ | |
130 | public $template_type; | |
c3fc2621 | 131 | |
703875d8 TO |
132 | /** |
133 | * Advanced options used by the email templating system. (JSON encoded) | |
134 | * | |
135 | * @var longtext | |
136 | */ | |
137 | public $template_options; | |
c3fc2621 | 138 | |
e501603b TO |
139 | /** |
140 | * Subject of mailing | |
141 | * | |
142 | * @var string | |
143 | */ | |
144 | public $subject; | |
c3fc2621 | 145 | |
e501603b TO |
146 | /** |
147 | * Body of the mailing in text format. | |
148 | * | |
149 | * @var longtext | |
150 | */ | |
151 | public $body_text; | |
c3fc2621 | 152 | |
e501603b TO |
153 | /** |
154 | * Body of the mailing in html format. | |
155 | * | |
156 | * @var longtext | |
157 | */ | |
158 | public $body_html; | |
c3fc2621 | 159 | |
e501603b TO |
160 | /** |
161 | * Should we track URL click-throughs for this mailing? | |
162 | * | |
e6ca0a57 | 163 | * @var bool |
e501603b TO |
164 | */ |
165 | public $url_tracking; | |
c3fc2621 | 166 | |
e501603b TO |
167 | /** |
168 | * Should we forward replies back to the author? | |
169 | * | |
e6ca0a57 | 170 | * @var bool |
e501603b TO |
171 | */ |
172 | public $forward_replies; | |
c3fc2621 | 173 | |
e501603b TO |
174 | /** |
175 | * Should we enable the auto-responder? | |
176 | * | |
e6ca0a57 | 177 | * @var bool |
e501603b TO |
178 | */ |
179 | public $auto_responder; | |
c3fc2621 | 180 | |
e501603b TO |
181 | /** |
182 | * Should we track when recipients open/read this mailing? | |
183 | * | |
e6ca0a57 | 184 | * @var bool |
e501603b TO |
185 | */ |
186 | public $open_tracking; | |
c3fc2621 | 187 | |
e501603b TO |
188 | /** |
189 | * Has at least one job associated with this mailing finished? | |
190 | * | |
e6ca0a57 | 191 | * @var bool |
e501603b TO |
192 | */ |
193 | public $is_completed; | |
c3fc2621 | 194 | |
e501603b TO |
195 | /** |
196 | * FK to the message template. | |
197 | * | |
e6ca0a57 | 198 | * @var int |
e501603b TO |
199 | */ |
200 | public $msg_template_id; | |
c3fc2621 | 201 | |
e501603b | 202 | /** |
d63dedfa | 203 | * Overwrite the VERP address in Reply-To |
e501603b | 204 | * |
e6ca0a57 | 205 | * @var bool |
e501603b TO |
206 | */ |
207 | public $override_verp; | |
c3fc2621 | 208 | |
e501603b TO |
209 | /** |
210 | * FK to Contact ID who first created this mailing | |
211 | * | |
e6ca0a57 | 212 | * @var int |
e501603b TO |
213 | */ |
214 | public $created_id; | |
c3fc2621 | 215 | |
e501603b TO |
216 | /** |
217 | * Date and time this mailing was created. | |
218 | * | |
6c2b97b7 | 219 | * @var timestamp |
e501603b TO |
220 | */ |
221 | public $created_date; | |
c3fc2621 | 222 | |
e7a6eae8 SL |
223 | /** |
224 | * When the mailing (or closely related entity) was created or modified or deleted. | |
225 | * | |
226 | * @var timestamp | |
227 | */ | |
228 | public $modified_date; | |
c3fc2621 | 229 | |
e501603b TO |
230 | /** |
231 | * FK to Contact ID who scheduled this mailing | |
232 | * | |
e6ca0a57 | 233 | * @var int |
e501603b TO |
234 | */ |
235 | public $scheduled_id; | |
c3fc2621 | 236 | |
e501603b TO |
237 | /** |
238 | * Date and time this mailing was scheduled. | |
239 | * | |
6c2b97b7 | 240 | * @var timestamp |
e501603b TO |
241 | */ |
242 | public $scheduled_date; | |
c3fc2621 | 243 | |
e501603b TO |
244 | /** |
245 | * FK to Contact ID who approved this mailing | |
246 | * | |
e6ca0a57 | 247 | * @var int |
e501603b TO |
248 | */ |
249 | public $approver_id; | |
c3fc2621 | 250 | |
e501603b TO |
251 | /** |
252 | * Date and time this mailing was approved. | |
253 | * | |
6c2b97b7 | 254 | * @var timestamp |
e501603b TO |
255 | */ |
256 | public $approval_date; | |
c3fc2621 | 257 | |
e501603b TO |
258 | /** |
259 | * The status of this mailing. Values: none, approved, rejected | |
260 | * | |
e6ca0a57 | 261 | * @var int |
e501603b TO |
262 | */ |
263 | public $approval_status_id; | |
c3fc2621 | 264 | |
e501603b TO |
265 | /** |
266 | * Note behind the decision. | |
267 | * | |
268 | * @var longtext | |
269 | */ | |
270 | public $approval_note; | |
c3fc2621 | 271 | |
e501603b TO |
272 | /** |
273 | * Is this mailing archived? | |
274 | * | |
e6ca0a57 | 275 | * @var bool |
e501603b TO |
276 | */ |
277 | public $is_archived; | |
c3fc2621 | 278 | |
e501603b TO |
279 | /** |
280 | * In what context(s) is the mailing contents visible (online viewing) | |
281 | * | |
282 | * @var string | |
283 | */ | |
284 | public $visibility; | |
c3fc2621 | 285 | |
e501603b TO |
286 | /** |
287 | * The campaign for which this mailing has been initiated. | |
288 | * | |
e6ca0a57 | 289 | * @var int |
e501603b TO |
290 | */ |
291 | public $campaign_id; | |
c3fc2621 | 292 | |
e501603b TO |
293 | /** |
294 | * Remove duplicate emails? | |
295 | * | |
e6ca0a57 | 296 | * @var bool |
e501603b TO |
297 | */ |
298 | public $dedupe_email; | |
c3fc2621 | 299 | |
e501603b | 300 | /** |
e6ca0a57 | 301 | * @var int |
e501603b TO |
302 | */ |
303 | public $sms_provider_id; | |
c3fc2621 | 304 | |
e501603b TO |
305 | /** |
306 | * Key for validating requests related to this mailing. | |
307 | * | |
308 | * @var string | |
309 | */ | |
310 | public $hash; | |
c3fc2621 | 311 | |
e501603b TO |
312 | /** |
313 | * With email_selection_method, determines which email address to use | |
314 | * | |
e6ca0a57 | 315 | * @var int |
e501603b TO |
316 | */ |
317 | public $location_type_id; | |
c3fc2621 | 318 | |
e501603b TO |
319 | /** |
320 | * With location_type_id, determine how to choose the email address to use. | |
321 | * | |
322 | * @var string | |
323 | */ | |
324 | public $email_selection_method; | |
c3fc2621 | 325 | |
10d3f7d3 SV |
326 | /** |
327 | * Language of the content of the mailing. Useful for tokens. | |
328 | * | |
329 | * @var string | |
330 | */ | |
331 | public $language; | |
c3fc2621 | 332 | |
e501603b | 333 | /** |
f41f0342 | 334 | * Class constructor. |
e501603b | 335 | */ |
c3fc2621 | 336 | public function __construct() { |
e501603b TO |
337 | $this->__table = 'civicrm_mailing'; |
338 | parent::__construct(); | |
339 | } | |
c3fc2621 | 340 | |
449c4e6b CW |
341 | /** |
342 | * Returns localized title of this entity. | |
343 | */ | |
344 | public static function getEntityTitle() { | |
345 | return ts('Mailings'); | |
346 | } | |
347 | ||
e501603b | 348 | /** |
f41f0342 | 349 | * Returns foreign keys and entity references. |
e501603b TO |
350 | * |
351 | * @return array | |
352 | * [CRM_Core_Reference_Interface] | |
353 | */ | |
c3fc2621 | 354 | public static function getReferenceColumns() { |
346aaaba | 355 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 356 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
357 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id'); |
358 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'header_id', 'civicrm_mailing_component', 'id'); | |
359 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'footer_id', 'civicrm_mailing_component', 'id'); | |
360 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'reply_id', 'civicrm_mailing_component', 'id'); | |
361 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'unsubscribe_id', 'civicrm_mailing_component', 'id'); | |
362 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'optout_id', 'civicrm_mailing_component', 'id'); | |
363 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id'); | |
364 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id'); | |
365 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'scheduled_id', 'civicrm_contact', 'id'); | |
366 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'approver_id', 'civicrm_contact', 'id'); | |
367 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'campaign_id', 'civicrm_campaign', 'id'); | |
368 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id'); | |
369 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'location_type_id', 'civicrm_location_type', 'id'); | |
346aaaba | 370 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 371 | } |
346aaaba | 372 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 373 | } |
c3fc2621 | 374 | |
e501603b TO |
375 | /** |
376 | * Returns all the column names of this table | |
377 | * | |
378 | * @return array | |
379 | */ | |
c3fc2621 | 380 | public static function &fields() { |
346aaaba | 381 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
382 | Civi::$statics[__CLASS__]['fields'] = [ |
383 | 'id' => [ | |
e501603b TO |
384 | 'name' => 'id', |
385 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
386 | 'title' => ts('Mailing ID'), |
387 | 'required' => TRUE, | |
a36434b9 | 388 | 'where' => 'civicrm_mailing.id', |
522a26c9 | 389 | 'table_name' => 'civicrm_mailing', |
390 | 'entity' => 'Mailing', | |
391 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 392 | 'localizable' => 0, |
c3fc2621 CW |
393 | ], |
394 | 'domain_id' => [ | |
e501603b TO |
395 | 'name' => 'domain_id', |
396 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 397 | 'title' => ts('Mailing Domain'), |
215b423e | 398 | 'description' => ts('Which site is this mailing for'), |
a36434b9 | 399 | 'where' => 'civicrm_mailing.domain_id', |
522a26c9 | 400 | 'table_name' => 'civicrm_mailing', |
401 | 'entity' => 'Mailing', | |
402 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 403 | 'localizable' => 0, |
e501603b | 404 | 'FKClassName' => 'CRM_Core_DAO_Domain', |
c3fc2621 | 405 | 'pseudoconstant' => [ |
e501603b TO |
406 | 'table' => 'civicrm_domain', |
407 | 'keyColumn' => 'id', | |
408 | 'labelColumn' => 'name', | |
e6ca0a57 | 409 | ], |
c3fc2621 CW |
410 | ], |
411 | 'header_id' => [ | |
e501603b TO |
412 | 'name' => 'header_id', |
413 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 414 | 'title' => ts('Mailing Header'), |
215b423e | 415 | 'description' => ts('FK to the header component.'), |
a36434b9 | 416 | 'where' => 'civicrm_mailing.header_id', |
522a26c9 | 417 | 'table_name' => 'civicrm_mailing', |
418 | 'entity' => 'Mailing', | |
419 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 420 | 'localizable' => 0, |
807f8008 | 421 | 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', |
3992bdad TO |
422 | 'pseudoconstant' => [ |
423 | 'table' => 'civicrm_mailing_component', | |
424 | 'keyColumn' => 'id', | |
425 | 'labelColumn' => 'name', | |
426 | 'condition' => 'component_type = "Header"', | |
427 | ], | |
c3fc2621 CW |
428 | ], |
429 | 'footer_id' => [ | |
e501603b TO |
430 | 'name' => 'footer_id', |
431 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 432 | 'title' => ts('Mailing Footer'), |
215b423e | 433 | 'description' => ts('FK to the footer component.'), |
a36434b9 | 434 | 'where' => 'civicrm_mailing.footer_id', |
522a26c9 | 435 | 'table_name' => 'civicrm_mailing', |
436 | 'entity' => 'Mailing', | |
437 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 438 | 'localizable' => 0, |
807f8008 | 439 | 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', |
3992bdad TO |
440 | 'pseudoconstant' => [ |
441 | 'table' => 'civicrm_mailing_component', | |
442 | 'keyColumn' => 'id', | |
443 | 'labelColumn' => 'name', | |
444 | 'condition' => 'component_type = "Footer"', | |
445 | ], | |
c3fc2621 CW |
446 | ], |
447 | 'reply_id' => [ | |
e501603b TO |
448 | 'name' => 'reply_id', |
449 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 450 | 'title' => ts('Mailing Reply'), |
215b423e | 451 | 'description' => ts('FK to the auto-responder component.'), |
a36434b9 | 452 | 'where' => 'civicrm_mailing.reply_id', |
522a26c9 | 453 | 'table_name' => 'civicrm_mailing', |
454 | 'entity' => 'Mailing', | |
455 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 456 | 'localizable' => 0, |
807f8008 | 457 | 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', |
c3fc2621 CW |
458 | ], |
459 | 'unsubscribe_id' => [ | |
e501603b TO |
460 | 'name' => 'unsubscribe_id', |
461 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 462 | 'title' => ts('Mailing Unsubscribe'), |
215b423e | 463 | 'description' => ts('FK to the unsubscribe component.'), |
a36434b9 | 464 | 'where' => 'civicrm_mailing.unsubscribe_id', |
522a26c9 | 465 | 'table_name' => 'civicrm_mailing', |
466 | 'entity' => 'Mailing', | |
467 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 468 | 'localizable' => 0, |
807f8008 | 469 | 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', |
c3fc2621 CW |
470 | ], |
471 | 'resubscribe_id' => [ | |
e501603b TO |
472 | 'name' => 'resubscribe_id', |
473 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 474 | 'title' => ts('Mailing Resubscribe'), |
a36434b9 | 475 | 'where' => 'civicrm_mailing.resubscribe_id', |
522a26c9 | 476 | 'table_name' => 'civicrm_mailing', |
477 | 'entity' => 'Mailing', | |
478 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 479 | 'localizable' => 0, |
c3fc2621 CW |
480 | ], |
481 | 'optout_id' => [ | |
e501603b TO |
482 | 'name' => 'optout_id', |
483 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 484 | 'title' => ts('Mailing Opt Out'), |
215b423e | 485 | 'description' => ts('FK to the opt-out component.'), |
a36434b9 | 486 | 'where' => 'civicrm_mailing.optout_id', |
522a26c9 | 487 | 'table_name' => 'civicrm_mailing', |
488 | 'entity' => 'Mailing', | |
489 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 490 | 'localizable' => 0, |
807f8008 | 491 | 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent', |
c3fc2621 | 492 | ], |
08d08c03 | 493 | 'mailing_name' => [ |
e501603b TO |
494 | 'name' => 'name', |
495 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 496 | 'title' => ts('Mailing Name'), |
215b423e | 497 | 'description' => ts('Mailing Name.'), |
e501603b TO |
498 | 'maxlength' => 128, |
499 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 500 | 'where' => 'civicrm_mailing.name', |
522a26c9 | 501 | 'table_name' => 'civicrm_mailing', |
502 | 'entity' => 'Mailing', | |
503 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 504 | 'localizable' => 0, |
c3fc2621 | 505 | 'html' => [ |
e501603b | 506 | 'type' => 'Text', |
c3fc2621 CW |
507 | ], |
508 | ], | |
509 | 'mailing_type' => [ | |
e501603b TO |
510 | 'name' => 'mailing_type', |
511 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 512 | 'title' => ts('Mailing Type'), |
215b423e | 513 | 'description' => ts('differentiate between standalone mailings, A/B tests, and A/B final-winner'), |
e501603b TO |
514 | 'maxlength' => 32, |
515 | 'size' => CRM_Utils_Type::MEDIUM, | |
a36434b9 | 516 | 'where' => 'civicrm_mailing.mailing_type', |
522a26c9 | 517 | 'table_name' => 'civicrm_mailing', |
518 | 'entity' => 'Mailing', | |
519 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 520 | 'localizable' => 0, |
c3fc2621 | 521 | 'html' => [ |
e501603b | 522 | 'type' => 'Select', |
c3fc2621 CW |
523 | ], |
524 | 'pseudoconstant' => [ | |
e501603b | 525 | 'callback' => 'CRM_Mailing_PseudoConstant::mailingTypes', |
e6ca0a57 | 526 | ], |
c3fc2621 CW |
527 | ], |
528 | 'from_name' => [ | |
e501603b TO |
529 | 'name' => 'from_name', |
530 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 531 | 'title' => ts('Mailing From Name'), |
215b423e | 532 | 'description' => ts('From Header of mailing'), |
e501603b TO |
533 | 'maxlength' => 128, |
534 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 535 | 'where' => 'civicrm_mailing.from_name', |
522a26c9 | 536 | 'table_name' => 'civicrm_mailing', |
537 | 'entity' => 'Mailing', | |
538 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 539 | 'localizable' => 0, |
c3fc2621 | 540 | 'html' => [ |
e501603b | 541 | 'type' => 'Text', |
c3fc2621 CW |
542 | ], |
543 | ], | |
544 | 'from_email' => [ | |
e501603b TO |
545 | 'name' => 'from_email', |
546 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 547 | 'title' => ts('Mailing From Email'), |
215b423e | 548 | 'description' => ts('From Email of mailing'), |
e501603b TO |
549 | 'maxlength' => 128, |
550 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 551 | 'where' => 'civicrm_mailing.from_email', |
522a26c9 | 552 | 'table_name' => 'civicrm_mailing', |
553 | 'entity' => 'Mailing', | |
554 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 555 | 'localizable' => 0, |
c3fc2621 | 556 | 'html' => [ |
e501603b | 557 | 'type' => 'Text', |
c3fc2621 CW |
558 | ], |
559 | ], | |
560 | 'replyto_email' => [ | |
e501603b TO |
561 | 'name' => 'replyto_email', |
562 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 563 | 'title' => ts('Replyto Email'), |
215b423e | 564 | 'description' => ts('Reply-To Email of mailing'), |
e501603b TO |
565 | 'maxlength' => 128, |
566 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 567 | 'where' => 'civicrm_mailing.replyto_email', |
522a26c9 | 568 | 'table_name' => 'civicrm_mailing', |
569 | 'entity' => 'Mailing', | |
570 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 571 | 'localizable' => 0, |
c3fc2621 | 572 | 'html' => [ |
e501603b | 573 | 'type' => 'Text', |
c3fc2621 CW |
574 | ], |
575 | ], | |
576 | 'template_type' => [ | |
703875d8 TO |
577 | 'name' => 'template_type', |
578 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 579 | 'title' => ts('Template Type'), |
215b423e | 580 | 'description' => ts('The language/processing system used for email templates.'), |
c3fc2621 | 581 | 'required' => TRUE, |
703875d8 TO |
582 | 'maxlength' => 64, |
583 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 584 | 'where' => 'civicrm_mailing.template_type', |
703875d8 | 585 | 'default' => 'traditional', |
522a26c9 | 586 | 'table_name' => 'civicrm_mailing', |
587 | 'entity' => 'Mailing', | |
588 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 589 | 'localizable' => 0, |
c3fc2621 | 590 | 'pseudoconstant' => [ |
703875d8 | 591 | 'callback' => 'CRM_Mailing_BAO_Mailing::getTemplateTypeNames', |
e6ca0a57 | 592 | ], |
c3fc2621 CW |
593 | ], |
594 | 'template_options' => [ | |
703875d8 TO |
595 | 'name' => 'template_options', |
596 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
c3fc2621 | 597 | 'title' => ts('Template Options (JSON)'), |
215b423e | 598 | 'description' => ts('Advanced options used by the email templating system. (JSON encoded)'), |
a36434b9 | 599 | 'where' => 'civicrm_mailing.template_options', |
522a26c9 | 600 | 'table_name' => 'civicrm_mailing', |
601 | 'entity' => 'Mailing', | |
602 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 603 | 'localizable' => 0, |
c3fc2621 CW |
604 | ], |
605 | 'subject' => [ | |
e501603b TO |
606 | 'name' => 'subject', |
607 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 608 | 'title' => ts('Subject'), |
215b423e | 609 | 'description' => ts('Subject of mailing'), |
e501603b TO |
610 | 'maxlength' => 128, |
611 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 612 | 'where' => 'civicrm_mailing.subject', |
522a26c9 | 613 | 'table_name' => 'civicrm_mailing', |
614 | 'entity' => 'Mailing', | |
615 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 616 | 'localizable' => 0, |
c3fc2621 | 617 | 'html' => [ |
e501603b | 618 | 'type' => 'Text', |
c3fc2621 CW |
619 | ], |
620 | ], | |
621 | 'body_text' => [ | |
e501603b TO |
622 | 'name' => 'body_text', |
623 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
c3fc2621 | 624 | 'title' => ts('Body Text'), |
215b423e | 625 | 'description' => ts('Body of the mailing in text format.'), |
a36434b9 | 626 | 'where' => 'civicrm_mailing.body_text', |
522a26c9 | 627 | 'table_name' => 'civicrm_mailing', |
628 | 'entity' => 'Mailing', | |
629 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 630 | 'localizable' => 0, |
c3fc2621 CW |
631 | ], |
632 | 'body_html' => [ | |
e501603b TO |
633 | 'name' => 'body_html', |
634 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
c3fc2621 | 635 | 'title' => ts('Body Html'), |
215b423e | 636 | 'description' => ts('Body of the mailing in html format.'), |
a36434b9 | 637 | 'where' => 'civicrm_mailing.body_html', |
522a26c9 | 638 | 'table_name' => 'civicrm_mailing', |
639 | 'entity' => 'Mailing', | |
640 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 641 | 'localizable' => 0, |
c3fc2621 CW |
642 | ], |
643 | 'url_tracking' => [ | |
e501603b TO |
644 | 'name' => 'url_tracking', |
645 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 646 | 'title' => ts('Url Tracking'), |
215b423e | 647 | 'description' => ts('Should we track URL click-throughs for this mailing?'), |
a36434b9 | 648 | 'where' => 'civicrm_mailing.url_tracking', |
522a26c9 | 649 | 'table_name' => 'civicrm_mailing', |
650 | 'entity' => 'Mailing', | |
651 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 652 | 'localizable' => 0, |
c3fc2621 | 653 | 'html' => [ |
e501603b | 654 | 'type' => 'CheckBox', |
c3fc2621 CW |
655 | ], |
656 | ], | |
657 | 'forward_replies' => [ | |
e501603b TO |
658 | 'name' => 'forward_replies', |
659 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 660 | 'title' => ts('Forward Replies'), |
215b423e | 661 | 'description' => ts('Should we forward replies back to the author?'), |
a36434b9 | 662 | 'where' => 'civicrm_mailing.forward_replies', |
522a26c9 | 663 | 'table_name' => 'civicrm_mailing', |
664 | 'entity' => 'Mailing', | |
665 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 666 | 'localizable' => 0, |
c3fc2621 | 667 | 'html' => [ |
e501603b | 668 | 'type' => 'CheckBox', |
c3fc2621 CW |
669 | ], |
670 | ], | |
671 | 'auto_responder' => [ | |
e501603b TO |
672 | 'name' => 'auto_responder', |
673 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 674 | 'title' => ts('Auto Responder'), |
215b423e | 675 | 'description' => ts('Should we enable the auto-responder?'), |
a36434b9 | 676 | 'where' => 'civicrm_mailing.auto_responder', |
522a26c9 | 677 | 'table_name' => 'civicrm_mailing', |
678 | 'entity' => 'Mailing', | |
679 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 680 | 'localizable' => 0, |
c3fc2621 | 681 | 'html' => [ |
e501603b | 682 | 'type' => 'CheckBox', |
c3fc2621 CW |
683 | ], |
684 | ], | |
685 | 'open_tracking' => [ | |
e501603b TO |
686 | 'name' => 'open_tracking', |
687 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 688 | 'title' => ts('Track Mailing?'), |
215b423e | 689 | 'description' => ts('Should we track when recipients open/read this mailing?'), |
a36434b9 | 690 | 'where' => 'civicrm_mailing.open_tracking', |
522a26c9 | 691 | 'table_name' => 'civicrm_mailing', |
692 | 'entity' => 'Mailing', | |
693 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 694 | 'localizable' => 0, |
c3fc2621 CW |
695 | ], |
696 | 'is_completed' => [ | |
e501603b TO |
697 | 'name' => 'is_completed', |
698 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 699 | 'title' => ts('Mailing Completed'), |
215b423e | 700 | 'description' => ts('Has at least one job associated with this mailing finished?'), |
a36434b9 | 701 | 'where' => 'civicrm_mailing.is_completed', |
522a26c9 | 702 | 'table_name' => 'civicrm_mailing', |
703 | 'entity' => 'Mailing', | |
704 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 705 | 'localizable' => 0, |
c3fc2621 | 706 | 'html' => [ |
e501603b | 707 | 'type' => 'CheckBox', |
c3fc2621 CW |
708 | ], |
709 | ], | |
710 | 'msg_template_id' => [ | |
e501603b TO |
711 | 'name' => 'msg_template_id', |
712 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 713 | 'title' => ts('Mailing Message Template'), |
215b423e | 714 | 'description' => ts('FK to the message template.'), |
a36434b9 | 715 | 'where' => 'civicrm_mailing.msg_template_id', |
522a26c9 | 716 | 'table_name' => 'civicrm_mailing', |
717 | 'entity' => 'Mailing', | |
718 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 719 | 'localizable' => 0, |
e501603b | 720 | 'FKClassName' => 'CRM_Core_DAO_MessageTemplate', |
c3fc2621 CW |
721 | ], |
722 | 'override_verp' => [ | |
e501603b TO |
723 | 'name' => 'override_verp', |
724 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 725 | 'title' => ts('Override Verp'), |
d63dedfa | 726 | 'description' => ts('Overwrite the VERP address in Reply-To'), |
a36434b9 | 727 | 'where' => 'civicrm_mailing.override_verp', |
45a83e42 | 728 | 'default' => '0', |
522a26c9 | 729 | 'table_name' => 'civicrm_mailing', |
730 | 'entity' => 'Mailing', | |
731 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 732 | 'localizable' => 0, |
c3fc2621 | 733 | 'html' => [ |
e501603b | 734 | 'type' => 'CheckBox', |
c3fc2621 CW |
735 | ], |
736 | ], | |
737 | 'created_id' => [ | |
e501603b TO |
738 | 'name' => 'created_id', |
739 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 740 | 'title' => ts('Mailing Creator'), |
215b423e | 741 | 'description' => ts('FK to Contact ID who first created this mailing'), |
a36434b9 | 742 | 'where' => 'civicrm_mailing.created_id', |
522a26c9 | 743 | 'table_name' => 'civicrm_mailing', |
744 | 'entity' => 'Mailing', | |
745 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 746 | 'localizable' => 0, |
e501603b | 747 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
c3fc2621 CW |
748 | ], |
749 | 'created_date' => [ | |
e501603b | 750 | 'name' => 'created_date', |
6c2b97b7 | 751 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 752 | 'title' => ts('Mailing Created Date'), |
215b423e | 753 | 'description' => ts('Date and time this mailing was created.'), |
c3fc2621 | 754 | 'required' => FALSE, |
a36434b9 | 755 | 'where' => 'civicrm_mailing.created_date', |
e7a6eae8 | 756 | 'default' => 'NULL', |
522a26c9 | 757 | 'table_name' => 'civicrm_mailing', |
758 | 'entity' => 'Mailing', | |
759 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 760 | 'localizable' => 0, |
c3fc2621 | 761 | 'html' => [ |
e501603b | 762 | 'type' => 'Select Date', |
6c2b97b7 | 763 | 'formatType' => 'activityDateTime', |
c3fc2621 CW |
764 | ], |
765 | ], | |
766 | 'mailing_modified_date' => [ | |
e7a6eae8 SL |
767 | 'name' => 'modified_date', |
768 | 'type' => CRM_Utils_Type::T_TIMESTAMP, | |
c3fc2621 | 769 | 'title' => ts('Modified Date'), |
215b423e | 770 | 'description' => ts('When the mailing (or closely related entity) was created or modified or deleted.'), |
c3fc2621 | 771 | 'required' => FALSE, |
e7a6eae8 | 772 | 'where' => 'civicrm_mailing.modified_date', |
a36434b9 | 773 | 'export' => TRUE, |
e7a6eae8 SL |
774 | 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', |
775 | 'table_name' => 'civicrm_mailing', | |
776 | 'entity' => 'Mailing', | |
777 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
778 | 'localizable' => 0, | |
c3fc2621 CW |
779 | ], |
780 | 'scheduled_id' => [ | |
e501603b TO |
781 | 'name' => 'scheduled_id', |
782 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 783 | 'title' => ts('Scheduled By'), |
215b423e | 784 | 'description' => ts('FK to Contact ID who scheduled this mailing'), |
a36434b9 | 785 | 'where' => 'civicrm_mailing.scheduled_id', |
522a26c9 | 786 | 'table_name' => 'civicrm_mailing', |
787 | 'entity' => 'Mailing', | |
788 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 789 | 'localizable' => 0, |
e501603b | 790 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
c3fc2621 CW |
791 | ], |
792 | 'scheduled_date' => [ | |
e501603b | 793 | 'name' => 'scheduled_date', |
6c2b97b7 | 794 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 795 | 'title' => ts('Mailing Scheduled Date'), |
215b423e | 796 | 'description' => ts('Date and time this mailing was scheduled.'), |
c3fc2621 | 797 | 'required' => FALSE, |
a36434b9 | 798 | 'where' => 'civicrm_mailing.scheduled_date', |
6c2b97b7 | 799 | 'default' => 'NULL', |
522a26c9 | 800 | 'table_name' => 'civicrm_mailing', |
801 | 'entity' => 'Mailing', | |
802 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 803 | 'localizable' => 0, |
c3fc2621 | 804 | 'html' => [ |
6c2b97b7 | 805 | 'type' => 'Select Date', |
806 | 'formatType' => 'activityDateTime', | |
c3fc2621 CW |
807 | ], |
808 | ], | |
809 | 'approver_id' => [ | |
e501603b TO |
810 | 'name' => 'approver_id', |
811 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 812 | 'title' => ts('Approved By'), |
215b423e | 813 | 'description' => ts('FK to Contact ID who approved this mailing'), |
a36434b9 | 814 | 'where' => 'civicrm_mailing.approver_id', |
522a26c9 | 815 | 'table_name' => 'civicrm_mailing', |
816 | 'entity' => 'Mailing', | |
817 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 818 | 'localizable' => 0, |
e501603b | 819 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
c3fc2621 CW |
820 | ], |
821 | 'approval_date' => [ | |
e501603b | 822 | 'name' => 'approval_date', |
6c2b97b7 | 823 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 824 | 'title' => ts('Mailing Approved Date'), |
215b423e | 825 | 'description' => ts('Date and time this mailing was approved.'), |
c3fc2621 | 826 | 'required' => FALSE, |
a36434b9 | 827 | 'where' => 'civicrm_mailing.approval_date', |
6c2b97b7 | 828 | 'default' => 'NULL', |
522a26c9 | 829 | 'table_name' => 'civicrm_mailing', |
830 | 'entity' => 'Mailing', | |
831 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 832 | 'localizable' => 0, |
c3fc2621 | 833 | 'html' => [ |
6c2b97b7 | 834 | 'type' => 'Select Date', |
835 | 'formatType' => 'activityDateTime', | |
c3fc2621 CW |
836 | ], |
837 | ], | |
838 | 'approval_status_id' => [ | |
e501603b TO |
839 | 'name' => 'approval_status_id', |
840 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 841 | 'title' => ts('Approval Status'), |
215b423e | 842 | 'description' => ts('The status of this mailing. Values: none, approved, rejected'), |
a36434b9 | 843 | 'where' => 'civicrm_mailing.approval_status_id', |
522a26c9 | 844 | 'table_name' => 'civicrm_mailing', |
845 | 'entity' => 'Mailing', | |
846 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 847 | 'localizable' => 0, |
c3fc2621 | 848 | 'html' => [ |
e501603b | 849 | 'type' => 'Select', |
c3fc2621 CW |
850 | ], |
851 | 'pseudoconstant' => [ | |
e501603b TO |
852 | 'optionGroupName' => 'mail_approval_status', |
853 | 'optionEditPath' => 'civicrm/admin/options/mail_approval_status', | |
e6ca0a57 | 854 | ], |
c3fc2621 CW |
855 | ], |
856 | 'approval_note' => [ | |
e501603b TO |
857 | 'name' => 'approval_note', |
858 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
c3fc2621 | 859 | 'title' => ts('Approval Note'), |
215b423e | 860 | 'description' => ts('Note behind the decision.'), |
a36434b9 | 861 | 'where' => 'civicrm_mailing.approval_note', |
522a26c9 | 862 | 'table_name' => 'civicrm_mailing', |
863 | 'entity' => 'Mailing', | |
864 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 865 | 'localizable' => 0, |
c3fc2621 | 866 | 'html' => [ |
e501603b | 867 | 'type' => 'TextArea', |
c3fc2621 CW |
868 | ], |
869 | ], | |
870 | 'is_archived' => [ | |
e501603b TO |
871 | 'name' => 'is_archived', |
872 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 873 | 'title' => ts('Is Mailing Archived?'), |
215b423e | 874 | 'description' => ts('Is this mailing archived?'), |
a36434b9 | 875 | 'where' => 'civicrm_mailing.is_archived', |
45a83e42 | 876 | 'default' => '0', |
522a26c9 | 877 | 'table_name' => 'civicrm_mailing', |
878 | 'entity' => 'Mailing', | |
879 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 880 | 'localizable' => 0, |
c3fc2621 | 881 | 'html' => [ |
e501603b | 882 | 'type' => 'CheckBox', |
c3fc2621 CW |
883 | ], |
884 | ], | |
885 | 'visibility' => [ | |
e501603b TO |
886 | 'name' => 'visibility', |
887 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 888 | 'title' => ts('Mailing Visibility'), |
215b423e | 889 | 'description' => ts('In what context(s) is the mailing contents visible (online viewing)'), |
e501603b TO |
890 | 'maxlength' => 40, |
891 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 892 | 'where' => 'civicrm_mailing.visibility', |
e501603b | 893 | 'default' => 'Public Pages', |
522a26c9 | 894 | 'table_name' => 'civicrm_mailing', |
895 | 'entity' => 'Mailing', | |
896 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 897 | 'localizable' => 0, |
c3fc2621 | 898 | 'html' => [ |
e501603b | 899 | 'type' => 'Select', |
c3fc2621 CW |
900 | ], |
901 | 'pseudoconstant' => [ | |
e501603b | 902 | 'callback' => 'CRM_Core_SelectValues::groupVisibility', |
e6ca0a57 | 903 | ], |
c3fc2621 CW |
904 | ], |
905 | 'campaign_id' => [ | |
e501603b TO |
906 | 'name' => 'campaign_id', |
907 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 908 | 'title' => ts('Mailing Campaign'), |
215b423e | 909 | 'description' => ts('The campaign for which this mailing has been initiated.'), |
a36434b9 | 910 | 'where' => 'civicrm_mailing.campaign_id', |
522a26c9 | 911 | 'table_name' => 'civicrm_mailing', |
912 | 'entity' => 'Mailing', | |
913 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 914 | 'localizable' => 0, |
e501603b | 915 | 'FKClassName' => 'CRM_Campaign_DAO_Campaign', |
c3fc2621 | 916 | 'html' => [ |
e501603b | 917 | 'type' => 'Select', |
c3fc2621 CW |
918 | ], |
919 | 'pseudoconstant' => [ | |
e501603b TO |
920 | 'table' => 'civicrm_campaign', |
921 | 'keyColumn' => 'id', | |
922 | 'labelColumn' => 'title', | |
e6ca0a57 | 923 | ], |
c3fc2621 CW |
924 | ], |
925 | 'dedupe_email' => [ | |
e501603b TO |
926 | 'name' => 'dedupe_email', |
927 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 928 | 'title' => ts('No Duplicate emails?'), |
215b423e | 929 | 'description' => ts('Remove duplicate emails?'), |
a36434b9 | 930 | 'where' => 'civicrm_mailing.dedupe_email', |
45a83e42 | 931 | 'default' => '0', |
522a26c9 | 932 | 'table_name' => 'civicrm_mailing', |
933 | 'entity' => 'Mailing', | |
934 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 935 | 'localizable' => 0, |
c3fc2621 | 936 | 'html' => [ |
e501603b | 937 | 'type' => 'CheckBox', |
c3fc2621 CW |
938 | ], |
939 | ], | |
940 | 'sms_provider_id' => [ | |
e501603b TO |
941 | 'name' => 'sms_provider_id', |
942 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 943 | 'title' => ts('Mailing SMS Provider'), |
a36434b9 | 944 | 'where' => 'civicrm_mailing.sms_provider_id', |
522a26c9 | 945 | 'table_name' => 'civicrm_mailing', |
946 | 'entity' => 'Mailing', | |
947 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 948 | 'localizable' => 0, |
e501603b | 949 | 'FKClassName' => 'CRM_SMS_DAO_Provider', |
c3fc2621 | 950 | 'html' => [ |
e501603b | 951 | 'type' => 'Select', |
c3fc2621 CW |
952 | ], |
953 | ], | |
954 | 'hash' => [ | |
e501603b TO |
955 | 'name' => 'hash', |
956 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 957 | 'title' => ts('Mailing Hash'), |
215b423e | 958 | 'description' => ts('Key for validating requests related to this mailing.'), |
e501603b TO |
959 | 'maxlength' => 16, |
960 | 'size' => CRM_Utils_Type::TWELVE, | |
a36434b9 | 961 | 'where' => 'civicrm_mailing.hash', |
522a26c9 | 962 | 'table_name' => 'civicrm_mailing', |
963 | 'entity' => 'Mailing', | |
964 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 965 | 'localizable' => 0, |
c3fc2621 CW |
966 | ], |
967 | 'location_type_id' => [ | |
e501603b TO |
968 | 'name' => 'location_type_id', |
969 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 970 | 'title' => ts('Location Type'), |
215b423e | 971 | 'description' => ts('With email_selection_method, determines which email address to use'), |
a36434b9 | 972 | 'where' => 'civicrm_mailing.location_type_id', |
522a26c9 | 973 | 'table_name' => 'civicrm_mailing', |
974 | 'entity' => 'Mailing', | |
975 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 976 | 'localizable' => 0, |
e501603b | 977 | 'FKClassName' => 'CRM_Core_DAO_LocationType', |
c3fc2621 | 978 | 'pseudoconstant' => [ |
e501603b TO |
979 | 'table' => 'civicrm_location_type', |
980 | 'keyColumn' => 'id', | |
981 | 'labelColumn' => 'display_name', | |
e6ca0a57 | 982 | ], |
c3fc2621 CW |
983 | ], |
984 | 'email_selection_method' => [ | |
e501603b TO |
985 | 'name' => 'email_selection_method', |
986 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 987 | 'title' => ts('Email Selection Method'), |
215b423e | 988 | 'description' => ts('With location_type_id, determine how to choose the email address to use.'), |
e501603b TO |
989 | 'maxlength' => 20, |
990 | 'size' => CRM_Utils_Type::MEDIUM, | |
a36434b9 | 991 | 'where' => 'civicrm_mailing.email_selection_method', |
e501603b | 992 | 'default' => 'automatic', |
522a26c9 | 993 | 'table_name' => 'civicrm_mailing', |
994 | 'entity' => 'Mailing', | |
995 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 996 | 'localizable' => 0, |
c3fc2621 | 997 | 'pseudoconstant' => [ |
e501603b | 998 | 'callback' => 'CRM_Core_SelectValues::emailSelectMethods', |
e6ca0a57 | 999 | ], |
c3fc2621 CW |
1000 | ], |
1001 | 'language' => [ | |
10d3f7d3 SV |
1002 | 'name' => 'language', |
1003 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 1004 | 'title' => ts('Mailing Language'), |
215b423e | 1005 | 'description' => ts('Language of the content of the mailing. Useful for tokens.'), |
10d3f7d3 SV |
1006 | 'maxlength' => 5, |
1007 | 'size' => CRM_Utils_Type::SIX, | |
a36434b9 | 1008 | 'where' => 'civicrm_mailing.language', |
522a26c9 | 1009 | 'table_name' => 'civicrm_mailing', |
1010 | 'entity' => 'Mailing', | |
1011 | 'bao' => 'CRM_Mailing_BAO_Mailing', | |
6a7e5e5d | 1012 | 'localizable' => 0, |
c3fc2621 | 1013 | 'html' => [ |
10d3f7d3 | 1014 | 'type' => 'Select', |
c3fc2621 CW |
1015 | ], |
1016 | 'pseudoconstant' => [ | |
10d3f7d3 SV |
1017 | 'optionGroupName' => 'languages', |
1018 | 'keyColumn' => 'name', | |
1019 | 'optionEditPath' => 'civicrm/admin/options/languages', | |
e6ca0a57 | 1020 | ], |
c3fc2621 CW |
1021 | ], |
1022 | ]; | |
346aaaba | 1023 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 1024 | } |
346aaaba | 1025 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 1026 | } |
c3fc2621 | 1027 | |
e501603b | 1028 | /** |
bd8e0b14 | 1029 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
1030 | * |
1031 | * @return array | |
bd8e0b14 | 1032 | * Array(string $name => string $uniqueName). |
e501603b | 1033 | */ |
c3fc2621 | 1034 | public static function &fieldKeys() { |
bd8e0b14 TO |
1035 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
1036 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 1037 | } |
bd8e0b14 | 1038 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 1039 | } |
c3fc2621 | 1040 | |
e501603b TO |
1041 | /** |
1042 | * Returns the names of this table | |
1043 | * | |
1044 | * @return string | |
1045 | */ | |
c3fc2621 | 1046 | public static function getTableName() { |
e501603b TO |
1047 | return self::$_tableName; |
1048 | } | |
c3fc2621 | 1049 | |
e501603b TO |
1050 | /** |
1051 | * Returns if this table needs to be logged | |
1052 | * | |
c3fc2621 | 1053 | * @return bool |
e501603b | 1054 | */ |
c3fc2621 | 1055 | public function getLog() { |
e501603b TO |
1056 | return self::$_log; |
1057 | } | |
c3fc2621 | 1058 | |
e501603b TO |
1059 | /** |
1060 | * Returns the list of fields that can be imported | |
1061 | * | |
1062 | * @param bool $prefix | |
1063 | * | |
1064 | * @return array | |
1065 | */ | |
c3fc2621 CW |
1066 | public static function &import($prefix = FALSE) { |
1067 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing', $prefix, []); | |
60808919 | 1068 | return $r; |
e501603b | 1069 | } |
c3fc2621 | 1070 | |
e501603b TO |
1071 | /** |
1072 | * Returns the list of fields that can be exported | |
1073 | * | |
1074 | * @param bool $prefix | |
1075 | * | |
1076 | * @return array | |
1077 | */ | |
c3fc2621 CW |
1078 | public static function &export($prefix = FALSE) { |
1079 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing', $prefix, []); | |
60808919 | 1080 | return $r; |
e501603b | 1081 | } |
c3fc2621 | 1082 | |
e7a6b91a AS |
1083 | /** |
1084 | * Returns the list of indices | |
c3fc2621 CW |
1085 | * |
1086 | * @param bool $localize | |
1087 | * | |
1088 | * @return array | |
e7a6b91a AS |
1089 | */ |
1090 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
1091 | $indices = [ |
1092 | 'index_hash' => [ | |
e7a6b91a | 1093 | 'name' => 'index_hash', |
c3fc2621 | 1094 | 'field' => [ |
e7a6b91a | 1095 | 0 => 'hash', |
c3fc2621 CW |
1096 | ], |
1097 | 'localizable' => FALSE, | |
e7a6b91a | 1098 | 'sig' => 'civicrm_mailing::0::hash', |
c3fc2621 CW |
1099 | ], |
1100 | ]; | |
e7a6b91a AS |
1101 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
1102 | } | |
c3fc2621 | 1103 | |
e501603b | 1104 | } |