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:9cd784dc86cf4f54983f14440be05239)
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 * @param bool $plural
347 * Whether to return the plural version of the title.
349 public static function getEntityTitle($plural = FALSE) {
350 return $plural ?
ts('Mailings') : ts('Mailing');
354 * Returns foreign keys and entity references.
357 * [CRM_Core_Reference_Interface]
359 public static function getReferenceColumns() {
360 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
361 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
362 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
363 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'header_id', 'civicrm_mailing_component', 'id');
364 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'footer_id', 'civicrm_mailing_component', 'id');
365 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'reply_id', 'civicrm_mailing_component', 'id');
366 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'unsubscribe_id', 'civicrm_mailing_component', 'id');
367 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'optout_id', 'civicrm_mailing_component', 'id');
368 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'msg_template_id', 'civicrm_msg_template', 'id');
369 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
370 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'scheduled_id', 'civicrm_contact', 'id');
371 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'approver_id', 'civicrm_contact', 'id');
372 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'campaign_id', 'civicrm_campaign', 'id');
373 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'sms_provider_id', 'civicrm_sms_provider', 'id');
374 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'location_type_id', 'civicrm_location_type', 'id');
375 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
377 return Civi
::$statics[__CLASS__
]['links'];
381 * Returns all the column names of this table
385 public static function &fields() {
386 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
387 Civi
::$statics[__CLASS__
]['fields'] = [
390 'type' => CRM_Utils_Type
::T_INT
,
391 'title' => ts('Mailing ID'),
393 'where' => 'civicrm_mailing.id',
394 'table_name' => 'civicrm_mailing',
395 'entity' => 'Mailing',
396 'bao' => 'CRM_Mailing_BAO_Mailing',
401 'name' => 'domain_id',
402 'type' => CRM_Utils_Type
::T_INT
,
403 'title' => ts('Mailing Domain'),
404 'description' => ts('Which site is this mailing for'),
405 'where' => 'civicrm_mailing.domain_id',
406 'table_name' => 'civicrm_mailing',
407 'entity' => 'Mailing',
408 'bao' => 'CRM_Mailing_BAO_Mailing',
410 'FKClassName' => 'CRM_Core_DAO_Domain',
411 'pseudoconstant' => [
412 'table' => 'civicrm_domain',
414 'labelColumn' => 'name',
419 'name' => 'header_id',
420 'type' => CRM_Utils_Type
::T_INT
,
421 'title' => ts('Mailing Header'),
422 'description' => ts('FK to the header component.'),
423 'where' => 'civicrm_mailing.header_id',
424 'table_name' => 'civicrm_mailing',
425 'entity' => 'Mailing',
426 'bao' => 'CRM_Mailing_BAO_Mailing',
428 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
429 'pseudoconstant' => [
430 'table' => 'civicrm_mailing_component',
432 'labelColumn' => 'name',
433 'condition' => 'component_type = "Header"',
438 'name' => 'footer_id',
439 'type' => CRM_Utils_Type
::T_INT
,
440 'title' => ts('Mailing Footer'),
441 'description' => ts('FK to the footer component.'),
442 'where' => 'civicrm_mailing.footer_id',
443 'table_name' => 'civicrm_mailing',
444 'entity' => 'Mailing',
445 'bao' => 'CRM_Mailing_BAO_Mailing',
447 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
448 'pseudoconstant' => [
449 'table' => 'civicrm_mailing_component',
451 'labelColumn' => 'name',
452 'condition' => 'component_type = "Footer"',
457 'name' => 'reply_id',
458 'type' => CRM_Utils_Type
::T_INT
,
459 'title' => ts('Mailing Reply'),
460 'description' => ts('FK to the auto-responder component.'),
461 'where' => 'civicrm_mailing.reply_id',
462 'table_name' => 'civicrm_mailing',
463 'entity' => 'Mailing',
464 'bao' => 'CRM_Mailing_BAO_Mailing',
466 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
469 'unsubscribe_id' => [
470 'name' => 'unsubscribe_id',
471 'type' => CRM_Utils_Type
::T_INT
,
472 'title' => ts('Mailing Unsubscribe'),
473 'description' => ts('FK to the unsubscribe component.'),
474 'where' => 'civicrm_mailing.unsubscribe_id',
475 'table_name' => 'civicrm_mailing',
476 'entity' => 'Mailing',
477 'bao' => 'CRM_Mailing_BAO_Mailing',
479 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
482 'resubscribe_id' => [
483 'name' => 'resubscribe_id',
484 'type' => CRM_Utils_Type
::T_INT
,
485 'title' => ts('Mailing Resubscribe'),
486 'where' => 'civicrm_mailing.resubscribe_id',
487 'table_name' => 'civicrm_mailing',
488 'entity' => 'Mailing',
489 'bao' => 'CRM_Mailing_BAO_Mailing',
494 'name' => 'optout_id',
495 'type' => CRM_Utils_Type
::T_INT
,
496 'title' => ts('Mailing Opt Out'),
497 'description' => ts('FK to the opt-out component.'),
498 'where' => 'civicrm_mailing.optout_id',
499 'table_name' => 'civicrm_mailing',
500 'entity' => 'Mailing',
501 'bao' => 'CRM_Mailing_BAO_Mailing',
503 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
508 'type' => CRM_Utils_Type
::T_STRING
,
509 'title' => ts('Mailing Name'),
510 'description' => ts('Mailing Name.'),
512 'size' => CRM_Utils_Type
::HUGE
,
513 'where' => 'civicrm_mailing.name',
514 'table_name' => 'civicrm_mailing',
515 'entity' => 'Mailing',
516 'bao' => 'CRM_Mailing_BAO_Mailing',
524 'name' => 'mailing_type',
525 'type' => CRM_Utils_Type
::T_STRING
,
526 'title' => ts('Mailing Type'),
527 'description' => ts('differentiate between standalone mailings, A/B tests, and A/B final-winner'),
529 'size' => CRM_Utils_Type
::MEDIUM
,
530 'where' => 'civicrm_mailing.mailing_type',
531 'table_name' => 'civicrm_mailing',
532 'entity' => 'Mailing',
533 'bao' => 'CRM_Mailing_BAO_Mailing',
538 'pseudoconstant' => [
539 'callback' => 'CRM_Mailing_PseudoConstant::mailingTypes',
544 'name' => 'from_name',
545 'type' => CRM_Utils_Type
::T_STRING
,
546 'title' => ts('Mailing From Name'),
547 'description' => ts('From Header of mailing'),
549 'size' => CRM_Utils_Type
::HUGE
,
550 'where' => 'civicrm_mailing.from_name',
551 'table_name' => 'civicrm_mailing',
552 'entity' => 'Mailing',
553 'bao' => 'CRM_Mailing_BAO_Mailing',
561 'name' => 'from_email',
562 'type' => CRM_Utils_Type
::T_STRING
,
563 'title' => ts('Mailing From Email'),
564 'description' => ts('From Email of mailing'),
566 'size' => CRM_Utils_Type
::HUGE
,
567 'where' => 'civicrm_mailing.from_email',
568 'table_name' => 'civicrm_mailing',
569 'entity' => 'Mailing',
570 'bao' => 'CRM_Mailing_BAO_Mailing',
578 'name' => 'replyto_email',
579 'type' => CRM_Utils_Type
::T_STRING
,
580 'title' => ts('Replyto Email'),
581 'description' => ts('Reply-To Email of mailing'),
583 'size' => CRM_Utils_Type
::HUGE
,
584 'where' => 'civicrm_mailing.replyto_email',
585 'table_name' => 'civicrm_mailing',
586 'entity' => 'Mailing',
587 'bao' => 'CRM_Mailing_BAO_Mailing',
595 'name' => 'template_type',
596 'type' => CRM_Utils_Type
::T_STRING
,
597 'title' => ts('Template Type'),
598 'description' => ts('The language/processing system used for email templates.'),
601 'size' => CRM_Utils_Type
::BIG
,
602 'where' => 'civicrm_mailing.template_type',
603 'default' => 'traditional',
604 'table_name' => 'civicrm_mailing',
605 'entity' => 'Mailing',
606 'bao' => 'CRM_Mailing_BAO_Mailing',
608 'pseudoconstant' => [
609 'callback' => 'CRM_Mailing_BAO_Mailing::getTemplateTypeNames',
613 'template_options' => [
614 'name' => 'template_options',
615 'type' => CRM_Utils_Type
::T_LONGTEXT
,
616 'title' => ts('Template Options (JSON)'),
617 'description' => ts('Advanced options used by the email templating system. (JSON encoded)'),
618 'where' => 'civicrm_mailing.template_options',
619 'table_name' => 'civicrm_mailing',
620 'entity' => 'Mailing',
621 'bao' => 'CRM_Mailing_BAO_Mailing',
627 'type' => CRM_Utils_Type
::T_STRING
,
628 'title' => ts('Subject'),
629 'description' => ts('Subject of mailing'),
631 'size' => CRM_Utils_Type
::HUGE
,
632 'where' => 'civicrm_mailing.subject',
633 'table_name' => 'civicrm_mailing',
634 'entity' => 'Mailing',
635 'bao' => 'CRM_Mailing_BAO_Mailing',
643 'name' => 'body_text',
644 'type' => CRM_Utils_Type
::T_LONGTEXT
,
645 'title' => ts('Body Text'),
646 'description' => ts('Body of the mailing in text format.'),
647 'where' => 'civicrm_mailing.body_text',
648 'table_name' => 'civicrm_mailing',
649 'entity' => 'Mailing',
650 'bao' => 'CRM_Mailing_BAO_Mailing',
655 'name' => 'body_html',
656 'type' => CRM_Utils_Type
::T_LONGTEXT
,
657 'title' => ts('Body Html'),
658 'description' => ts('Body of the mailing in html format.'),
659 'where' => 'civicrm_mailing.body_html',
660 'table_name' => 'civicrm_mailing',
661 'entity' => 'Mailing',
662 'bao' => 'CRM_Mailing_BAO_Mailing',
667 'name' => 'url_tracking',
668 'type' => CRM_Utils_Type
::T_BOOLEAN
,
669 'title' => ts('Url Tracking'),
670 'description' => ts('Should we track URL click-throughs for this mailing?'),
671 'where' => 'civicrm_mailing.url_tracking',
672 'table_name' => 'civicrm_mailing',
673 'entity' => 'Mailing',
674 'bao' => 'CRM_Mailing_BAO_Mailing',
677 'type' => 'CheckBox',
681 'forward_replies' => [
682 'name' => 'forward_replies',
683 'type' => CRM_Utils_Type
::T_BOOLEAN
,
684 'title' => ts('Forward Replies'),
685 'description' => ts('Should we forward replies back to the author?'),
686 'where' => 'civicrm_mailing.forward_replies',
687 'table_name' => 'civicrm_mailing',
688 'entity' => 'Mailing',
689 'bao' => 'CRM_Mailing_BAO_Mailing',
692 'type' => 'CheckBox',
696 'auto_responder' => [
697 'name' => 'auto_responder',
698 'type' => CRM_Utils_Type
::T_BOOLEAN
,
699 'title' => ts('Auto Responder'),
700 'description' => ts('Should we enable the auto-responder?'),
701 'where' => 'civicrm_mailing.auto_responder',
702 'table_name' => 'civicrm_mailing',
703 'entity' => 'Mailing',
704 'bao' => 'CRM_Mailing_BAO_Mailing',
707 'type' => 'CheckBox',
712 'name' => 'open_tracking',
713 'type' => CRM_Utils_Type
::T_BOOLEAN
,
714 'title' => ts('Track Mailing?'),
715 'description' => ts('Should we track when recipients open/read this mailing?'),
716 'where' => 'civicrm_mailing.open_tracking',
717 'table_name' => 'civicrm_mailing',
718 'entity' => 'Mailing',
719 'bao' => 'CRM_Mailing_BAO_Mailing',
724 'name' => 'is_completed',
725 'type' => CRM_Utils_Type
::T_BOOLEAN
,
726 'title' => ts('Mailing Completed'),
727 'description' => ts('Has at least one job associated with this mailing finished?'),
728 'where' => 'civicrm_mailing.is_completed',
729 'table_name' => 'civicrm_mailing',
730 'entity' => 'Mailing',
731 'bao' => 'CRM_Mailing_BAO_Mailing',
734 'type' => 'CheckBox',
738 'msg_template_id' => [
739 'name' => 'msg_template_id',
740 'type' => CRM_Utils_Type
::T_INT
,
741 'title' => ts('Mailing Message Template'),
742 'description' => ts('FK to the message template.'),
743 'where' => 'civicrm_mailing.msg_template_id',
744 'table_name' => 'civicrm_mailing',
745 'entity' => 'Mailing',
746 'bao' => 'CRM_Mailing_BAO_Mailing',
748 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
752 'name' => 'override_verp',
753 'type' => CRM_Utils_Type
::T_BOOLEAN
,
754 'title' => ts('Override Verp'),
755 'description' => ts('Overwrite the VERP address in Reply-To'),
756 'where' => 'civicrm_mailing.override_verp',
758 'table_name' => 'civicrm_mailing',
759 'entity' => 'Mailing',
760 'bao' => 'CRM_Mailing_BAO_Mailing',
763 'type' => 'CheckBox',
768 'name' => 'created_id',
769 'type' => CRM_Utils_Type
::T_INT
,
770 'title' => ts('Mailing Creator'),
771 'description' => ts('FK to Contact ID who first created this mailing'),
772 'where' => 'civicrm_mailing.created_id',
773 'table_name' => 'civicrm_mailing',
774 'entity' => 'Mailing',
775 'bao' => 'CRM_Mailing_BAO_Mailing',
777 'FKClassName' => 'CRM_Contact_DAO_Contact',
781 'name' => 'created_date',
782 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
783 'title' => ts('Mailing Created Date'),
784 'description' => ts('Date and time this mailing was created.'),
786 'where' => 'civicrm_mailing.created_date',
788 'table_name' => 'civicrm_mailing',
789 'entity' => 'Mailing',
790 'bao' => 'CRM_Mailing_BAO_Mailing',
793 'type' => 'Select Date',
794 'formatType' => 'activityDateTime',
798 'mailing_modified_date' => [
799 'name' => 'modified_date',
800 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
801 'title' => ts('Modified Date'),
802 'description' => ts('When the mailing (or closely related entity) was created or modified or deleted.'),
804 'where' => 'civicrm_mailing.modified_date',
806 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
807 'table_name' => 'civicrm_mailing',
808 'entity' => 'Mailing',
809 'bao' => 'CRM_Mailing_BAO_Mailing',
814 'name' => 'scheduled_id',
815 'type' => CRM_Utils_Type
::T_INT
,
816 'title' => ts('Scheduled By'),
817 'description' => ts('FK to Contact ID who scheduled this mailing'),
818 'where' => 'civicrm_mailing.scheduled_id',
819 'table_name' => 'civicrm_mailing',
820 'entity' => 'Mailing',
821 'bao' => 'CRM_Mailing_BAO_Mailing',
823 'FKClassName' => 'CRM_Contact_DAO_Contact',
826 'scheduled_date' => [
827 'name' => 'scheduled_date',
828 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
829 'title' => ts('Mailing Scheduled Date'),
830 'description' => ts('Date and time this mailing was scheduled.'),
832 'where' => 'civicrm_mailing.scheduled_date',
834 'table_name' => 'civicrm_mailing',
835 'entity' => 'Mailing',
836 'bao' => 'CRM_Mailing_BAO_Mailing',
839 'type' => 'Select Date',
840 'formatType' => 'activityDateTime',
845 'name' => 'approver_id',
846 'type' => CRM_Utils_Type
::T_INT
,
847 'title' => ts('Approved By'),
848 'description' => ts('FK to Contact ID who approved this mailing'),
849 'where' => 'civicrm_mailing.approver_id',
850 'table_name' => 'civicrm_mailing',
851 'entity' => 'Mailing',
852 'bao' => 'CRM_Mailing_BAO_Mailing',
854 'FKClassName' => 'CRM_Contact_DAO_Contact',
858 'name' => 'approval_date',
859 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
860 'title' => ts('Mailing Approved Date'),
861 'description' => ts('Date and time this mailing was approved.'),
863 'where' => 'civicrm_mailing.approval_date',
865 'table_name' => 'civicrm_mailing',
866 'entity' => 'Mailing',
867 'bao' => 'CRM_Mailing_BAO_Mailing',
870 'type' => 'Select Date',
871 'formatType' => 'activityDateTime',
875 'approval_status_id' => [
876 'name' => 'approval_status_id',
877 'type' => CRM_Utils_Type
::T_INT
,
878 'title' => ts('Approval Status'),
879 'description' => ts('The status of this mailing. Values: none, approved, rejected'),
880 'where' => 'civicrm_mailing.approval_status_id',
881 'table_name' => 'civicrm_mailing',
882 'entity' => 'Mailing',
883 'bao' => 'CRM_Mailing_BAO_Mailing',
888 'pseudoconstant' => [
889 'optionGroupName' => 'mail_approval_status',
890 'optionEditPath' => 'civicrm/admin/options/mail_approval_status',
895 'name' => 'approval_note',
896 'type' => CRM_Utils_Type
::T_LONGTEXT
,
897 'title' => ts('Approval Note'),
898 'description' => ts('Note behind the decision.'),
899 'where' => 'civicrm_mailing.approval_note',
900 'table_name' => 'civicrm_mailing',
901 'entity' => 'Mailing',
902 'bao' => 'CRM_Mailing_BAO_Mailing',
905 'type' => 'TextArea',
910 'name' => 'is_archived',
911 'type' => CRM_Utils_Type
::T_BOOLEAN
,
912 'title' => ts('Is Mailing Archived?'),
913 'description' => ts('Is this mailing archived?'),
914 'where' => 'civicrm_mailing.is_archived',
916 'table_name' => 'civicrm_mailing',
917 'entity' => 'Mailing',
918 'bao' => 'CRM_Mailing_BAO_Mailing',
921 'type' => 'CheckBox',
926 'name' => 'visibility',
927 'type' => CRM_Utils_Type
::T_STRING
,
928 'title' => ts('Mailing Visibility'),
929 'description' => ts('In what context(s) is the mailing contents visible (online viewing)'),
931 'size' => CRM_Utils_Type
::BIG
,
932 'where' => 'civicrm_mailing.visibility',
933 'default' => 'Public Pages',
934 'table_name' => 'civicrm_mailing',
935 'entity' => 'Mailing',
936 'bao' => 'CRM_Mailing_BAO_Mailing',
941 'pseudoconstant' => [
942 'callback' => 'CRM_Core_SelectValues::groupVisibility',
947 'name' => 'campaign_id',
948 'type' => CRM_Utils_Type
::T_INT
,
949 'title' => ts('Mailing Campaign'),
950 'description' => ts('The campaign for which this mailing has been initiated.'),
951 'where' => 'civicrm_mailing.campaign_id',
952 'table_name' => 'civicrm_mailing',
953 'entity' => 'Mailing',
954 'bao' => 'CRM_Mailing_BAO_Mailing',
956 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
960 'pseudoconstant' => [
961 'table' => 'civicrm_campaign',
963 'labelColumn' => 'title',
968 'name' => 'dedupe_email',
969 'type' => CRM_Utils_Type
::T_BOOLEAN
,
970 'title' => ts('No Duplicate emails?'),
971 'description' => ts('Remove duplicate emails?'),
972 'where' => 'civicrm_mailing.dedupe_email',
974 'table_name' => 'civicrm_mailing',
975 'entity' => 'Mailing',
976 'bao' => 'CRM_Mailing_BAO_Mailing',
979 'type' => 'CheckBox',
983 'sms_provider_id' => [
984 'name' => 'sms_provider_id',
985 'type' => CRM_Utils_Type
::T_INT
,
986 'title' => ts('Mailing SMS Provider'),
987 'where' => 'civicrm_mailing.sms_provider_id',
988 'table_name' => 'civicrm_mailing',
989 'entity' => 'Mailing',
990 'bao' => 'CRM_Mailing_BAO_Mailing',
992 'FKClassName' => 'CRM_SMS_DAO_Provider',
1000 'type' => CRM_Utils_Type
::T_STRING
,
1001 'title' => ts('Mailing Hash'),
1002 'description' => ts('Key for validating requests related to this mailing.'),
1004 'size' => CRM_Utils_Type
::TWELVE
,
1005 'where' => 'civicrm_mailing.hash',
1006 'table_name' => 'civicrm_mailing',
1007 'entity' => 'Mailing',
1008 'bao' => 'CRM_Mailing_BAO_Mailing',
1012 'location_type_id' => [
1013 'name' => 'location_type_id',
1014 'type' => CRM_Utils_Type
::T_INT
,
1015 'title' => ts('Location Type'),
1016 'description' => ts('With email_selection_method, determines which email address to use'),
1017 'where' => 'civicrm_mailing.location_type_id',
1018 'table_name' => 'civicrm_mailing',
1019 'entity' => 'Mailing',
1020 'bao' => 'CRM_Mailing_BAO_Mailing',
1022 'FKClassName' => 'CRM_Core_DAO_LocationType',
1023 'pseudoconstant' => [
1024 'table' => 'civicrm_location_type',
1025 'keyColumn' => 'id',
1026 'labelColumn' => 'display_name',
1030 'email_selection_method' => [
1031 'name' => 'email_selection_method',
1032 'type' => CRM_Utils_Type
::T_STRING
,
1033 'title' => ts('Email Selection Method'),
1034 'description' => ts('With location_type_id, determine how to choose the email address to use.'),
1036 'size' => CRM_Utils_Type
::MEDIUM
,
1037 'where' => 'civicrm_mailing.email_selection_method',
1038 'default' => 'automatic',
1039 'table_name' => 'civicrm_mailing',
1040 'entity' => 'Mailing',
1041 'bao' => 'CRM_Mailing_BAO_Mailing',
1043 'pseudoconstant' => [
1044 'callback' => 'CRM_Core_SelectValues::emailSelectMethods',
1049 'name' => 'language',
1050 'type' => CRM_Utils_Type
::T_STRING
,
1051 'title' => ts('Mailing Language'),
1052 'description' => ts('Language of the content of the mailing. Useful for tokens.'),
1054 'size' => CRM_Utils_Type
::SIX
,
1055 'where' => 'civicrm_mailing.language',
1056 'table_name' => 'civicrm_mailing',
1057 'entity' => 'Mailing',
1058 'bao' => 'CRM_Mailing_BAO_Mailing',
1063 'pseudoconstant' => [
1064 'optionGroupName' => 'languages',
1065 'keyColumn' => 'name',
1066 'optionEditPath' => 'civicrm/admin/options/languages',
1071 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
1073 return Civi
::$statics[__CLASS__
]['fields'];
1077 * Return a mapping from field-name to the corresponding key (as used in fields()).
1080 * Array(string $name => string $uniqueName).
1082 public static function &fieldKeys() {
1083 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
1084 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
1086 return Civi
::$statics[__CLASS__
]['fieldKeys'];
1090 * Returns the names of this table
1094 public static function getTableName() {
1095 return self
::$_tableName;
1099 * Returns if this table needs to be logged
1103 public function getLog() {
1108 * Returns the list of fields that can be imported
1110 * @param bool $prefix
1114 public static function &import($prefix = FALSE) {
1115 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing', $prefix, []);
1120 * Returns the list of fields that can be exported
1122 * @param bool $prefix
1126 public static function &export($prefix = FALSE) {
1127 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing', $prefix, []);
1132 * Returns the list of indices
1134 * @param bool $localize
1138 public static function indices($localize = TRUE) {
1141 'name' => 'index_hash',
1145 'localizable' => FALSE,
1146 'sig' => 'civicrm_mailing::0::hash',
1149 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;