5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Mailing.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6a9dc5aaff7aa7f5dcfe3f892255e357)
13 * Database access object for the Mailing entity.
15 class CRM_Mailing_DAO_Mailing
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing';
27 * Icon associated with this entity.
31 public static $_icon = 'fa-envelope-o';
34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
38 public static $_log = FALSE;
46 * Which site is this mailing for
53 * FK to the header component.
60 * FK to the footer component.
67 * FK to the auto-responder component.
74 * FK to the unsubscribe component.
78 public $unsubscribe_id;
83 public $resubscribe_id;
86 * FK to the opt-out component.
100 * differentiate between standalone mailings, A/B tests, and A/B final-winner
104 public $mailing_type;
107 * From Header of mailing
114 * From Email of mailing
121 * Reply-To Email of mailing
125 public $replyto_email;
128 * The language/processing system used for email templates.
132 public $template_type;
135 * Advanced options used by the email templating system. (JSON encoded)
139 public $template_options;
149 * Body of the mailing in text format.
156 * Body of the mailing in html format.
163 * Should we track URL click-throughs for this mailing?
167 public $url_tracking;
170 * Should we forward replies back to the author?
174 public $forward_replies;
177 * Should we enable the auto-responder?
181 public $auto_responder;
184 * Should we track when recipients open/read this mailing?
188 public $open_tracking;
191 * Has at least one job associated with this mailing finished?
195 public $is_completed;
198 * FK to the message template.
202 public $msg_template_id;
205 * Overwrite the VERP address in Reply-To
209 public $override_verp;
212 * FK to Contact ID who first created this mailing
219 * Date and time this mailing was created.
223 public $created_date;
226 * When the mailing (or closely related entity) was created or modified or deleted.
230 public $modified_date;
233 * FK to Contact ID who scheduled this mailing
237 public $scheduled_id;
240 * Date and time this mailing was scheduled.
244 public $scheduled_date;
247 * FK to Contact ID who approved this mailing
254 * Date and time this mailing was approved.
258 public $approval_date;
261 * The status of this mailing. Values: none, approved, rejected
265 public $approval_status_id;
268 * Note behind the decision.
272 public $approval_note;
275 * Is this mailing archived?
282 * In what context(s) is the mailing contents visible (online viewing)
289 * The campaign for which this mailing has been initiated.
296 * Remove duplicate emails?
300 public $dedupe_email;
305 public $sms_provider_id;
308 * Key for validating requests related to this mailing.
315 * With email_selection_method, determines which email address to use
319 public $location_type_id;
322 * With location_type_id, determine how to choose the email address to use.
326 public $email_selection_method;
329 * Language of the content of the mailing. Useful for tokens.
338 public function __construct() {
339 $this->__table
= 'civicrm_mailing';
340 parent
::__construct();
344 * Returns localized title of this entity.
346 public static function getEntityTitle() {
347 return ts('Mailings');
351 * Returns foreign keys and entity references.
354 * [CRM_Core_Reference_Interface]
356 public static function getReferenceColumns() {
357 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
358 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
359 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
360 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'header_id', 'civicrm_mailing_component', 'id');
361 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'footer_id', 'civicrm_mailing_component', 'id');
362 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'reply_id', 'civicrm_mailing_component', 'id');
363 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'unsubscribe_id', 'civicrm_mailing_component', 'id');
364 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'optout_id', 'civicrm_mailing_component', 'id');
365 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
366 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
367 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'scheduled_id', 'civicrm_contact', 'id');
368 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'approver_id', 'civicrm_contact', 'id');
369 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
370 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
371 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'location_type_id', 'civicrm_location_type', 'id');
372 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
374 return Civi
::$statics[__CLASS__
]['links'];
378 * Returns all the column names of this table
382 public static function &fields() {
383 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
384 Civi
::$statics[__CLASS__
]['fields'] = [
387 'type' => CRM_Utils_Type
::T_INT
,
388 'title' => ts('Mailing ID'),
390 'where' => 'civicrm_mailing.id',
391 'table_name' => 'civicrm_mailing',
392 'entity' => 'Mailing',
393 'bao' => 'CRM_Mailing_BAO_Mailing',
398 'name' => 'domain_id',
399 'type' => CRM_Utils_Type
::T_INT
,
400 'title' => ts('Mailing Domain'),
401 'description' => ts('Which site is this mailing for'),
402 'where' => 'civicrm_mailing.domain_id',
403 'table_name' => 'civicrm_mailing',
404 'entity' => 'Mailing',
405 'bao' => 'CRM_Mailing_BAO_Mailing',
407 'FKClassName' => 'CRM_Core_DAO_Domain',
408 'pseudoconstant' => [
409 'table' => 'civicrm_domain',
411 'labelColumn' => 'name',
416 'name' => 'header_id',
417 'type' => CRM_Utils_Type
::T_INT
,
418 'title' => ts('Mailing Header'),
419 'description' => ts('FK to the header component.'),
420 'where' => 'civicrm_mailing.header_id',
421 'table_name' => 'civicrm_mailing',
422 'entity' => 'Mailing',
423 'bao' => 'CRM_Mailing_BAO_Mailing',
425 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
426 'pseudoconstant' => [
427 'table' => 'civicrm_mailing_component',
429 'labelColumn' => 'name',
430 'condition' => 'component_type = "Header"',
435 'name' => 'footer_id',
436 'type' => CRM_Utils_Type
::T_INT
,
437 'title' => ts('Mailing Footer'),
438 'description' => ts('FK to the footer component.'),
439 'where' => 'civicrm_mailing.footer_id',
440 'table_name' => 'civicrm_mailing',
441 'entity' => 'Mailing',
442 'bao' => 'CRM_Mailing_BAO_Mailing',
444 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
445 'pseudoconstant' => [
446 'table' => 'civicrm_mailing_component',
448 'labelColumn' => 'name',
449 'condition' => 'component_type = "Footer"',
454 'name' => 'reply_id',
455 'type' => CRM_Utils_Type
::T_INT
,
456 'title' => ts('Mailing Reply'),
457 'description' => ts('FK to the auto-responder component.'),
458 'where' => 'civicrm_mailing.reply_id',
459 'table_name' => 'civicrm_mailing',
460 'entity' => 'Mailing',
461 'bao' => 'CRM_Mailing_BAO_Mailing',
463 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
466 'unsubscribe_id' => [
467 'name' => 'unsubscribe_id',
468 'type' => CRM_Utils_Type
::T_INT
,
469 'title' => ts('Mailing Unsubscribe'),
470 'description' => ts('FK to the unsubscribe component.'),
471 'where' => 'civicrm_mailing.unsubscribe_id',
472 'table_name' => 'civicrm_mailing',
473 'entity' => 'Mailing',
474 'bao' => 'CRM_Mailing_BAO_Mailing',
476 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
479 'resubscribe_id' => [
480 'name' => 'resubscribe_id',
481 'type' => CRM_Utils_Type
::T_INT
,
482 'title' => ts('Mailing Resubscribe'),
483 'where' => 'civicrm_mailing.resubscribe_id',
484 'table_name' => 'civicrm_mailing',
485 'entity' => 'Mailing',
486 'bao' => 'CRM_Mailing_BAO_Mailing',
491 'name' => 'optout_id',
492 'type' => CRM_Utils_Type
::T_INT
,
493 'title' => ts('Mailing Opt Out'),
494 'description' => ts('FK to the opt-out component.'),
495 'where' => 'civicrm_mailing.optout_id',
496 'table_name' => 'civicrm_mailing',
497 'entity' => 'Mailing',
498 'bao' => 'CRM_Mailing_BAO_Mailing',
500 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
505 'type' => CRM_Utils_Type
::T_STRING
,
506 'title' => ts('Mailing Name'),
507 'description' => ts('Mailing Name.'),
509 'size' => CRM_Utils_Type
::HUGE
,
510 'where' => 'civicrm_mailing.name',
511 'table_name' => 'civicrm_mailing',
512 'entity' => 'Mailing',
513 'bao' => 'CRM_Mailing_BAO_Mailing',
521 'name' => 'mailing_type',
522 'type' => CRM_Utils_Type
::T_STRING
,
523 'title' => ts('Mailing Type'),
524 'description' => ts('differentiate between standalone mailings, A/B tests, and A/B final-winner'),
526 'size' => CRM_Utils_Type
::MEDIUM
,
527 'where' => 'civicrm_mailing.mailing_type',
528 'table_name' => 'civicrm_mailing',
529 'entity' => 'Mailing',
530 'bao' => 'CRM_Mailing_BAO_Mailing',
535 'pseudoconstant' => [
536 'callback' => 'CRM_Mailing_PseudoConstant::mailingTypes',
541 'name' => 'from_name',
542 'type' => CRM_Utils_Type
::T_STRING
,
543 'title' => ts('Mailing From Name'),
544 'description' => ts('From Header of mailing'),
546 'size' => CRM_Utils_Type
::HUGE
,
547 'where' => 'civicrm_mailing.from_name',
548 'table_name' => 'civicrm_mailing',
549 'entity' => 'Mailing',
550 'bao' => 'CRM_Mailing_BAO_Mailing',
558 'name' => 'from_email',
559 'type' => CRM_Utils_Type
::T_STRING
,
560 'title' => ts('Mailing From Email'),
561 'description' => ts('From Email of mailing'),
563 'size' => CRM_Utils_Type
::HUGE
,
564 'where' => 'civicrm_mailing.from_email',
565 'table_name' => 'civicrm_mailing',
566 'entity' => 'Mailing',
567 'bao' => 'CRM_Mailing_BAO_Mailing',
575 'name' => 'replyto_email',
576 'type' => CRM_Utils_Type
::T_STRING
,
577 'title' => ts('Replyto Email'),
578 'description' => ts('Reply-To Email of mailing'),
580 'size' => CRM_Utils_Type
::HUGE
,
581 'where' => 'civicrm_mailing.replyto_email',
582 'table_name' => 'civicrm_mailing',
583 'entity' => 'Mailing',
584 'bao' => 'CRM_Mailing_BAO_Mailing',
592 'name' => 'template_type',
593 'type' => CRM_Utils_Type
::T_STRING
,
594 'title' => ts('Template Type'),
595 'description' => ts('The language/processing system used for email templates.'),
598 'size' => CRM_Utils_Type
::BIG
,
599 'where' => 'civicrm_mailing.template_type',
600 'default' => 'traditional',
601 'table_name' => 'civicrm_mailing',
602 'entity' => 'Mailing',
603 'bao' => 'CRM_Mailing_BAO_Mailing',
605 'pseudoconstant' => [
606 'callback' => 'CRM_Mailing_BAO_Mailing::getTemplateTypeNames',
610 'template_options' => [
611 'name' => 'template_options',
612 'type' => CRM_Utils_Type
::T_LONGTEXT
,
613 'title' => ts('Template Options (JSON)'),
614 'description' => ts('Advanced options used by the email templating system. (JSON encoded)'),
615 'where' => 'civicrm_mailing.template_options',
616 'table_name' => 'civicrm_mailing',
617 'entity' => 'Mailing',
618 'bao' => 'CRM_Mailing_BAO_Mailing',
624 'type' => CRM_Utils_Type
::T_STRING
,
625 'title' => ts('Subject'),
626 'description' => ts('Subject of mailing'),
628 'size' => CRM_Utils_Type
::HUGE
,
629 'where' => 'civicrm_mailing.subject',
630 'table_name' => 'civicrm_mailing',
631 'entity' => 'Mailing',
632 'bao' => 'CRM_Mailing_BAO_Mailing',
640 'name' => 'body_text',
641 'type' => CRM_Utils_Type
::T_LONGTEXT
,
642 'title' => ts('Body Text'),
643 'description' => ts('Body of the mailing in text format.'),
644 'where' => 'civicrm_mailing.body_text',
645 'table_name' => 'civicrm_mailing',
646 'entity' => 'Mailing',
647 'bao' => 'CRM_Mailing_BAO_Mailing',
652 'name' => 'body_html',
653 'type' => CRM_Utils_Type
::T_LONGTEXT
,
654 'title' => ts('Body Html'),
655 'description' => ts('Body of the mailing in html format.'),
656 'where' => 'civicrm_mailing.body_html',
657 'table_name' => 'civicrm_mailing',
658 'entity' => 'Mailing',
659 'bao' => 'CRM_Mailing_BAO_Mailing',
664 'name' => 'url_tracking',
665 'type' => CRM_Utils_Type
::T_BOOLEAN
,
666 'title' => ts('Url Tracking'),
667 'description' => ts('Should we track URL click-throughs for this mailing?'),
668 'where' => 'civicrm_mailing.url_tracking',
669 'table_name' => 'civicrm_mailing',
670 'entity' => 'Mailing',
671 'bao' => 'CRM_Mailing_BAO_Mailing',
674 'type' => 'CheckBox',
678 'forward_replies' => [
679 'name' => 'forward_replies',
680 'type' => CRM_Utils_Type
::T_BOOLEAN
,
681 'title' => ts('Forward Replies'),
682 'description' => ts('Should we forward replies back to the author?'),
683 'where' => 'civicrm_mailing.forward_replies',
684 'table_name' => 'civicrm_mailing',
685 'entity' => 'Mailing',
686 'bao' => 'CRM_Mailing_BAO_Mailing',
689 'type' => 'CheckBox',
693 'auto_responder' => [
694 'name' => 'auto_responder',
695 'type' => CRM_Utils_Type
::T_BOOLEAN
,
696 'title' => ts('Auto Responder'),
697 'description' => ts('Should we enable the auto-responder?'),
698 'where' => 'civicrm_mailing.auto_responder',
699 'table_name' => 'civicrm_mailing',
700 'entity' => 'Mailing',
701 'bao' => 'CRM_Mailing_BAO_Mailing',
704 'type' => 'CheckBox',
709 'name' => 'open_tracking',
710 'type' => CRM_Utils_Type
::T_BOOLEAN
,
711 'title' => ts('Track Mailing?'),
712 'description' => ts('Should we track when recipients open/read this mailing?'),
713 'where' => 'civicrm_mailing.open_tracking',
714 'table_name' => 'civicrm_mailing',
715 'entity' => 'Mailing',
716 'bao' => 'CRM_Mailing_BAO_Mailing',
721 'name' => 'is_completed',
722 'type' => CRM_Utils_Type
::T_BOOLEAN
,
723 'title' => ts('Mailing Completed'),
724 'description' => ts('Has at least one job associated with this mailing finished?'),
725 'where' => 'civicrm_mailing.is_completed',
726 'table_name' => 'civicrm_mailing',
727 'entity' => 'Mailing',
728 'bao' => 'CRM_Mailing_BAO_Mailing',
731 'type' => 'CheckBox',
735 'msg_template_id' => [
736 'name' => 'msg_template_id',
737 'type' => CRM_Utils_Type
::T_INT
,
738 'title' => ts('Mailing Message Template'),
739 'description' => ts('FK to the message template.'),
740 'where' => 'civicrm_mailing.msg_template_id',
741 'table_name' => 'civicrm_mailing',
742 'entity' => 'Mailing',
743 'bao' => 'CRM_Mailing_BAO_Mailing',
745 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
749 'name' => 'override_verp',
750 'type' => CRM_Utils_Type
::T_BOOLEAN
,
751 'title' => ts('Override Verp'),
752 'description' => ts('Overwrite the VERP address in Reply-To'),
753 'where' => 'civicrm_mailing.override_verp',
755 'table_name' => 'civicrm_mailing',
756 'entity' => 'Mailing',
757 'bao' => 'CRM_Mailing_BAO_Mailing',
760 'type' => 'CheckBox',
765 'name' => 'created_id',
766 'type' => CRM_Utils_Type
::T_INT
,
767 'title' => ts('Mailing Creator'),
768 'description' => ts('FK to Contact ID who first created this mailing'),
769 'where' => 'civicrm_mailing.created_id',
770 'table_name' => 'civicrm_mailing',
771 'entity' => 'Mailing',
772 'bao' => 'CRM_Mailing_BAO_Mailing',
774 'FKClassName' => 'CRM_Contact_DAO_Contact',
778 'name' => 'created_date',
779 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
780 'title' => ts('Mailing Created Date'),
781 'description' => ts('Date and time this mailing was created.'),
783 'where' => 'civicrm_mailing.created_date',
785 'table_name' => 'civicrm_mailing',
786 'entity' => 'Mailing',
787 'bao' => 'CRM_Mailing_BAO_Mailing',
790 'type' => 'Select Date',
791 'formatType' => 'activityDateTime',
795 'mailing_modified_date' => [
796 'name' => 'modified_date',
797 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
798 'title' => ts('Modified Date'),
799 'description' => ts('When the mailing (or closely related entity) was created or modified or deleted.'),
801 'where' => 'civicrm_mailing.modified_date',
803 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
804 'table_name' => 'civicrm_mailing',
805 'entity' => 'Mailing',
806 'bao' => 'CRM_Mailing_BAO_Mailing',
811 'name' => 'scheduled_id',
812 'type' => CRM_Utils_Type
::T_INT
,
813 'title' => ts('Scheduled By'),
814 'description' => ts('FK to Contact ID who scheduled this mailing'),
815 'where' => 'civicrm_mailing.scheduled_id',
816 'table_name' => 'civicrm_mailing',
817 'entity' => 'Mailing',
818 'bao' => 'CRM_Mailing_BAO_Mailing',
820 'FKClassName' => 'CRM_Contact_DAO_Contact',
823 'scheduled_date' => [
824 'name' => 'scheduled_date',
825 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
826 'title' => ts('Mailing Scheduled Date'),
827 'description' => ts('Date and time this mailing was scheduled.'),
829 'where' => 'civicrm_mailing.scheduled_date',
831 'table_name' => 'civicrm_mailing',
832 'entity' => 'Mailing',
833 'bao' => 'CRM_Mailing_BAO_Mailing',
836 'type' => 'Select Date',
837 'formatType' => 'activityDateTime',
842 'name' => 'approver_id',
843 'type' => CRM_Utils_Type
::T_INT
,
844 'title' => ts('Approved By'),
845 'description' => ts('FK to Contact ID who approved this mailing'),
846 'where' => 'civicrm_mailing.approver_id',
847 'table_name' => 'civicrm_mailing',
848 'entity' => 'Mailing',
849 'bao' => 'CRM_Mailing_BAO_Mailing',
851 'FKClassName' => 'CRM_Contact_DAO_Contact',
855 'name' => 'approval_date',
856 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
857 'title' => ts('Mailing Approved Date'),
858 'description' => ts('Date and time this mailing was approved.'),
860 'where' => 'civicrm_mailing.approval_date',
862 'table_name' => 'civicrm_mailing',
863 'entity' => 'Mailing',
864 'bao' => 'CRM_Mailing_BAO_Mailing',
867 'type' => 'Select Date',
868 'formatType' => 'activityDateTime',
872 'approval_status_id' => [
873 'name' => 'approval_status_id',
874 'type' => CRM_Utils_Type
::T_INT
,
875 'title' => ts('Approval Status'),
876 'description' => ts('The status of this mailing. Values: none, approved, rejected'),
877 'where' => 'civicrm_mailing.approval_status_id',
878 'table_name' => 'civicrm_mailing',
879 'entity' => 'Mailing',
880 'bao' => 'CRM_Mailing_BAO_Mailing',
885 'pseudoconstant' => [
886 'optionGroupName' => 'mail_approval_status',
887 'optionEditPath' => 'civicrm/admin/options/mail_approval_status',
892 'name' => 'approval_note',
893 'type' => CRM_Utils_Type
::T_LONGTEXT
,
894 'title' => ts('Approval Note'),
895 'description' => ts('Note behind the decision.'),
896 'where' => 'civicrm_mailing.approval_note',
897 'table_name' => 'civicrm_mailing',
898 'entity' => 'Mailing',
899 'bao' => 'CRM_Mailing_BAO_Mailing',
902 'type' => 'TextArea',
907 'name' => 'is_archived',
908 'type' => CRM_Utils_Type
::T_BOOLEAN
,
909 'title' => ts('Is Mailing Archived?'),
910 'description' => ts('Is this mailing archived?'),
911 'where' => 'civicrm_mailing.is_archived',
913 'table_name' => 'civicrm_mailing',
914 'entity' => 'Mailing',
915 'bao' => 'CRM_Mailing_BAO_Mailing',
918 'type' => 'CheckBox',
923 'name' => 'visibility',
924 'type' => CRM_Utils_Type
::T_STRING
,
925 'title' => ts('Mailing Visibility'),
926 'description' => ts('In what context(s) is the mailing contents visible (online viewing)'),
928 'size' => CRM_Utils_Type
::BIG
,
929 'where' => 'civicrm_mailing.visibility',
930 'default' => 'Public Pages',
931 'table_name' => 'civicrm_mailing',
932 'entity' => 'Mailing',
933 'bao' => 'CRM_Mailing_BAO_Mailing',
938 'pseudoconstant' => [
939 'callback' => 'CRM_Core_SelectValues::groupVisibility',
944 'name' => 'campaign_id',
945 'type' => CRM_Utils_Type
::T_INT
,
946 'title' => ts('Mailing Campaign'),
947 'description' => ts('The campaign for which this mailing has been initiated.'),
948 'where' => 'civicrm_mailing.campaign_id',
949 'table_name' => 'civicrm_mailing',
950 'entity' => 'Mailing',
951 'bao' => 'CRM_Mailing_BAO_Mailing',
953 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
957 'pseudoconstant' => [
958 'table' => 'civicrm_campaign',
960 'labelColumn' => 'title',
965 'name' => 'dedupe_email',
966 'type' => CRM_Utils_Type
::T_BOOLEAN
,
967 'title' => ts('No Duplicate emails?'),
968 'description' => ts('Remove duplicate emails?'),
969 'where' => 'civicrm_mailing.dedupe_email',
971 'table_name' => 'civicrm_mailing',
972 'entity' => 'Mailing',
973 'bao' => 'CRM_Mailing_BAO_Mailing',
976 'type' => 'CheckBox',
980 'sms_provider_id' => [
981 'name' => 'sms_provider_id',
982 'type' => CRM_Utils_Type
::T_INT
,
983 'title' => ts('Mailing SMS Provider'),
984 'where' => 'civicrm_mailing.sms_provider_id',
985 'table_name' => 'civicrm_mailing',
986 'entity' => 'Mailing',
987 'bao' => 'CRM_Mailing_BAO_Mailing',
989 'FKClassName' => 'CRM_SMS_DAO_Provider',
997 'type' => CRM_Utils_Type
::T_STRING
,
998 'title' => ts('Mailing Hash'),
999 'description' => ts('Key for validating requests related to this mailing.'),
1001 'size' => CRM_Utils_Type
::TWELVE
,
1002 'where' => 'civicrm_mailing.hash',
1003 'table_name' => 'civicrm_mailing',
1004 'entity' => 'Mailing',
1005 'bao' => 'CRM_Mailing_BAO_Mailing',
1009 'location_type_id' => [
1010 'name' => 'location_type_id',
1011 'type' => CRM_Utils_Type
::T_INT
,
1012 'title' => ts('Location Type'),
1013 'description' => ts('With email_selection_method, determines which email address to use'),
1014 'where' => 'civicrm_mailing.location_type_id',
1015 'table_name' => 'civicrm_mailing',
1016 'entity' => 'Mailing',
1017 'bao' => 'CRM_Mailing_BAO_Mailing',
1019 'FKClassName' => 'CRM_Core_DAO_LocationType',
1020 'pseudoconstant' => [
1021 'table' => 'civicrm_location_type',
1022 'keyColumn' => 'id',
1023 'labelColumn' => 'display_name',
1027 'email_selection_method' => [
1028 'name' => 'email_selection_method',
1029 'type' => CRM_Utils_Type
::T_STRING
,
1030 'title' => ts('Email Selection Method'),
1031 'description' => ts('With location_type_id, determine how to choose the email address to use.'),
1033 'size' => CRM_Utils_Type
::MEDIUM
,
1034 'where' => 'civicrm_mailing.email_selection_method',
1035 'default' => 'automatic',
1036 'table_name' => 'civicrm_mailing',
1037 'entity' => 'Mailing',
1038 'bao' => 'CRM_Mailing_BAO_Mailing',
1040 'pseudoconstant' => [
1041 'callback' => 'CRM_Core_SelectValues::emailSelectMethods',
1046 'name' => 'language',
1047 'type' => CRM_Utils_Type
::T_STRING
,
1048 'title' => ts('Mailing Language'),
1049 'description' => ts('Language of the content of the mailing. Useful for tokens.'),
1051 'size' => CRM_Utils_Type
::SIX
,
1052 'where' => 'civicrm_mailing.language',
1053 'table_name' => 'civicrm_mailing',
1054 'entity' => 'Mailing',
1055 'bao' => 'CRM_Mailing_BAO_Mailing',
1060 'pseudoconstant' => [
1061 'optionGroupName' => 'languages',
1062 'keyColumn' => 'name',
1063 'optionEditPath' => 'civicrm/admin/options/languages',
1068 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
1070 return Civi
::$statics[__CLASS__
]['fields'];
1074 * Return a mapping from field-name to the corresponding key (as used in fields()).
1077 * Array(string $name => string $uniqueName).
1079 public static function &fieldKeys() {
1080 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
1081 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
1083 return Civi
::$statics[__CLASS__
]['fieldKeys'];
1087 * Returns the names of this table
1091 public static function getTableName() {
1092 return self
::$_tableName;
1096 * Returns if this table needs to be logged
1100 public function getLog() {
1105 * Returns the list of fields that can be imported
1107 * @param bool $prefix
1111 public static function &import($prefix = FALSE) {
1112 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing', $prefix, []);
1117 * Returns the list of fields that can be exported
1119 * @param bool $prefix
1123 public static function &export($prefix = FALSE) {
1124 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing', $prefix, []);
1129 * Returns the list of indices
1131 * @param bool $localize
1135 public static function indices($localize = TRUE) {
1138 'name' => 'index_hash',
1142 'localizable' => FALSE,
1143 'sig' => 'civicrm_mailing::0::hash',
1146 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;