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:bfcc85d4eb2bab05f214dd946e5fdef6)
13 * Database access object for the Mailing entity.
15 class CRM_Mailing_DAO_Mailing
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing';
25 * Icon associated with this entity.
29 public static $_icon = 'fa-envelope-o';
32 * Should CiviCRM log any modifications to this table in the civicrm_log table.
36 public static $_log = FALSE;
44 * Which site is this mailing for
51 * FK to the header component.
58 * FK to the footer component.
65 * FK to the auto-responder component.
72 * FK to the unsubscribe component.
76 public $unsubscribe_id;
81 public $resubscribe_id;
84 * FK to the opt-out component.
98 * differentiate between standalone mailings, A/B tests, and A/B final-winner
102 public $mailing_type;
105 * From Header of mailing
112 * From Email of mailing
119 * Reply-To Email of mailing
123 public $replyto_email;
126 * The language/processing system used for email templates.
130 public $template_type;
133 * Advanced options used by the email templating system. (JSON encoded)
137 public $template_options;
147 * Body of the mailing in text format.
154 * Body of the mailing in html format.
161 * Should we track URL click-throughs for this mailing?
165 public $url_tracking;
168 * Should we forward replies back to the author?
172 public $forward_replies;
175 * Should we enable the auto-responder?
179 public $auto_responder;
182 * Should we track when recipients open/read this mailing?
186 public $open_tracking;
189 * Has at least one job associated with this mailing finished?
193 public $is_completed;
196 * FK to the message template.
200 public $msg_template_id;
203 * Overwrite the VERP address in Reply-To
207 public $override_verp;
210 * FK to Contact ID who first created this mailing
217 * Date and time this mailing was created.
221 public $created_date;
224 * When the mailing (or closely related entity) was created or modified or deleted.
228 public $modified_date;
231 * FK to Contact ID who scheduled this mailing
235 public $scheduled_id;
238 * Date and time this mailing was scheduled.
242 public $scheduled_date;
245 * FK to Contact ID who approved this mailing
252 * Date and time this mailing was approved.
256 public $approval_date;
259 * The status of this mailing. Values: none, approved, rejected
263 public $approval_status_id;
266 * Note behind the decision.
270 public $approval_note;
273 * Is this mailing archived?
280 * In what context(s) is the mailing contents visible (online viewing)
287 * The campaign for which this mailing has been initiated.
294 * Remove duplicate emails?
298 public $dedupe_email;
303 public $sms_provider_id;
306 * Key for validating requests related to this mailing.
313 * With email_selection_method, determines which email address to use
317 public $location_type_id;
320 * With location_type_id, determine how to choose the email address to use.
324 public $email_selection_method;
327 * Language of the content of the mailing. Useful for tokens.
336 public function __construct() {
337 $this->__table
= 'civicrm_mailing';
338 parent
::__construct();
342 * Returns localized title of this entity.
344 public static function getEntityTitle() {
345 return ts('Mailings');
349 * Returns foreign keys and entity references.
352 * [CRM_Core_Reference_Interface]
354 public static function getReferenceColumns() {
355 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
356 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
370 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
372 return Civi
::$statics[__CLASS__
]['links'];
376 * Returns all the column names of this table
380 public static function &fields() {
381 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
382 Civi
::$statics[__CLASS__
]['fields'] = [
385 'type' => CRM_Utils_Type
::T_INT
,
386 'title' => ts('Mailing ID'),
388 'where' => 'civicrm_mailing.id',
389 'table_name' => 'civicrm_mailing',
390 'entity' => 'Mailing',
391 'bao' => 'CRM_Mailing_BAO_Mailing',
396 'name' => 'domain_id',
397 'type' => CRM_Utils_Type
::T_INT
,
398 'title' => ts('Mailing Domain'),
399 'description' => ts('Which site is this mailing for'),
400 'where' => 'civicrm_mailing.domain_id',
401 'table_name' => 'civicrm_mailing',
402 'entity' => 'Mailing',
403 'bao' => 'CRM_Mailing_BAO_Mailing',
405 'FKClassName' => 'CRM_Core_DAO_Domain',
406 'pseudoconstant' => [
407 'table' => 'civicrm_domain',
409 'labelColumn' => 'name',
414 'name' => 'header_id',
415 'type' => CRM_Utils_Type
::T_INT
,
416 'title' => ts('Mailing Header'),
417 'description' => ts('FK to the header component.'),
418 'where' => 'civicrm_mailing.header_id',
419 'table_name' => 'civicrm_mailing',
420 'entity' => 'Mailing',
421 'bao' => 'CRM_Mailing_BAO_Mailing',
423 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
424 'pseudoconstant' => [
425 'table' => 'civicrm_mailing_component',
427 'labelColumn' => 'name',
428 'condition' => 'component_type = "Header"',
433 'name' => 'footer_id',
434 'type' => CRM_Utils_Type
::T_INT
,
435 'title' => ts('Mailing Footer'),
436 'description' => ts('FK to the footer component.'),
437 'where' => 'civicrm_mailing.footer_id',
438 'table_name' => 'civicrm_mailing',
439 'entity' => 'Mailing',
440 'bao' => 'CRM_Mailing_BAO_Mailing',
442 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
443 'pseudoconstant' => [
444 'table' => 'civicrm_mailing_component',
446 'labelColumn' => 'name',
447 'condition' => 'component_type = "Footer"',
452 'name' => 'reply_id',
453 'type' => CRM_Utils_Type
::T_INT
,
454 'title' => ts('Mailing Reply'),
455 'description' => ts('FK to the auto-responder component.'),
456 'where' => 'civicrm_mailing.reply_id',
457 'table_name' => 'civicrm_mailing',
458 'entity' => 'Mailing',
459 'bao' => 'CRM_Mailing_BAO_Mailing',
461 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
464 'unsubscribe_id' => [
465 'name' => 'unsubscribe_id',
466 'type' => CRM_Utils_Type
::T_INT
,
467 'title' => ts('Mailing Unsubscribe'),
468 'description' => ts('FK to the unsubscribe component.'),
469 'where' => 'civicrm_mailing.unsubscribe_id',
470 'table_name' => 'civicrm_mailing',
471 'entity' => 'Mailing',
472 'bao' => 'CRM_Mailing_BAO_Mailing',
474 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
477 'resubscribe_id' => [
478 'name' => 'resubscribe_id',
479 'type' => CRM_Utils_Type
::T_INT
,
480 'title' => ts('Mailing Resubscribe'),
481 'where' => 'civicrm_mailing.resubscribe_id',
482 'table_name' => 'civicrm_mailing',
483 'entity' => 'Mailing',
484 'bao' => 'CRM_Mailing_BAO_Mailing',
489 'name' => 'optout_id',
490 'type' => CRM_Utils_Type
::T_INT
,
491 'title' => ts('Mailing Opt Out'),
492 'description' => ts('FK to the opt-out component.'),
493 'where' => 'civicrm_mailing.optout_id',
494 'table_name' => 'civicrm_mailing',
495 'entity' => 'Mailing',
496 'bao' => 'CRM_Mailing_BAO_Mailing',
498 'FKClassName' => 'CRM_Mailing_DAO_MailingComponent',
503 'type' => CRM_Utils_Type
::T_STRING
,
504 'title' => ts('Mailing Name'),
505 'description' => ts('Mailing Name.'),
507 'size' => CRM_Utils_Type
::HUGE
,
508 'where' => 'civicrm_mailing.name',
509 'table_name' => 'civicrm_mailing',
510 'entity' => 'Mailing',
511 'bao' => 'CRM_Mailing_BAO_Mailing',
519 'name' => 'mailing_type',
520 'type' => CRM_Utils_Type
::T_STRING
,
521 'title' => ts('Mailing Type'),
522 'description' => ts('differentiate between standalone mailings, A/B tests, and A/B final-winner'),
524 'size' => CRM_Utils_Type
::MEDIUM
,
525 'where' => 'civicrm_mailing.mailing_type',
526 'table_name' => 'civicrm_mailing',
527 'entity' => 'Mailing',
528 'bao' => 'CRM_Mailing_BAO_Mailing',
533 'pseudoconstant' => [
534 'callback' => 'CRM_Mailing_PseudoConstant::mailingTypes',
539 'name' => 'from_name',
540 'type' => CRM_Utils_Type
::T_STRING
,
541 'title' => ts('Mailing From Name'),
542 'description' => ts('From Header of mailing'),
544 'size' => CRM_Utils_Type
::HUGE
,
545 'where' => 'civicrm_mailing.from_name',
546 'table_name' => 'civicrm_mailing',
547 'entity' => 'Mailing',
548 'bao' => 'CRM_Mailing_BAO_Mailing',
556 'name' => 'from_email',
557 'type' => CRM_Utils_Type
::T_STRING
,
558 'title' => ts('Mailing From Email'),
559 'description' => ts('From Email of mailing'),
561 'size' => CRM_Utils_Type
::HUGE
,
562 'where' => 'civicrm_mailing.from_email',
563 'table_name' => 'civicrm_mailing',
564 'entity' => 'Mailing',
565 'bao' => 'CRM_Mailing_BAO_Mailing',
573 'name' => 'replyto_email',
574 'type' => CRM_Utils_Type
::T_STRING
,
575 'title' => ts('Replyto Email'),
576 'description' => ts('Reply-To Email of mailing'),
578 'size' => CRM_Utils_Type
::HUGE
,
579 'where' => 'civicrm_mailing.replyto_email',
580 'table_name' => 'civicrm_mailing',
581 'entity' => 'Mailing',
582 'bao' => 'CRM_Mailing_BAO_Mailing',
590 'name' => 'template_type',
591 'type' => CRM_Utils_Type
::T_STRING
,
592 'title' => ts('Template Type'),
593 'description' => ts('The language/processing system used for email templates.'),
596 'size' => CRM_Utils_Type
::BIG
,
597 'where' => 'civicrm_mailing.template_type',
598 'default' => 'traditional',
599 'table_name' => 'civicrm_mailing',
600 'entity' => 'Mailing',
601 'bao' => 'CRM_Mailing_BAO_Mailing',
603 'pseudoconstant' => [
604 'callback' => 'CRM_Mailing_BAO_Mailing::getTemplateTypeNames',
608 'template_options' => [
609 'name' => 'template_options',
610 'type' => CRM_Utils_Type
::T_LONGTEXT
,
611 'title' => ts('Template Options (JSON)'),
612 'description' => ts('Advanced options used by the email templating system. (JSON encoded)'),
613 'where' => 'civicrm_mailing.template_options',
614 'table_name' => 'civicrm_mailing',
615 'entity' => 'Mailing',
616 'bao' => 'CRM_Mailing_BAO_Mailing',
622 'type' => CRM_Utils_Type
::T_STRING
,
623 'title' => ts('Subject'),
624 'description' => ts('Subject of mailing'),
626 'size' => CRM_Utils_Type
::HUGE
,
627 'where' => 'civicrm_mailing.subject',
628 'table_name' => 'civicrm_mailing',
629 'entity' => 'Mailing',
630 'bao' => 'CRM_Mailing_BAO_Mailing',
638 'name' => 'body_text',
639 'type' => CRM_Utils_Type
::T_LONGTEXT
,
640 'title' => ts('Body Text'),
641 'description' => ts('Body of the mailing in text format.'),
642 'where' => 'civicrm_mailing.body_text',
643 'table_name' => 'civicrm_mailing',
644 'entity' => 'Mailing',
645 'bao' => 'CRM_Mailing_BAO_Mailing',
650 'name' => 'body_html',
651 'type' => CRM_Utils_Type
::T_LONGTEXT
,
652 'title' => ts('Body Html'),
653 'description' => ts('Body of the mailing in html format.'),
654 'where' => 'civicrm_mailing.body_html',
655 'table_name' => 'civicrm_mailing',
656 'entity' => 'Mailing',
657 'bao' => 'CRM_Mailing_BAO_Mailing',
662 'name' => 'url_tracking',
663 'type' => CRM_Utils_Type
::T_BOOLEAN
,
664 'title' => ts('Url Tracking'),
665 'description' => ts('Should we track URL click-throughs for this mailing?'),
666 'where' => 'civicrm_mailing.url_tracking',
667 'table_name' => 'civicrm_mailing',
668 'entity' => 'Mailing',
669 'bao' => 'CRM_Mailing_BAO_Mailing',
672 'type' => 'CheckBox',
676 'forward_replies' => [
677 'name' => 'forward_replies',
678 'type' => CRM_Utils_Type
::T_BOOLEAN
,
679 'title' => ts('Forward Replies'),
680 'description' => ts('Should we forward replies back to the author?'),
681 'where' => 'civicrm_mailing.forward_replies',
682 'table_name' => 'civicrm_mailing',
683 'entity' => 'Mailing',
684 'bao' => 'CRM_Mailing_BAO_Mailing',
687 'type' => 'CheckBox',
691 'auto_responder' => [
692 'name' => 'auto_responder',
693 'type' => CRM_Utils_Type
::T_BOOLEAN
,
694 'title' => ts('Auto Responder'),
695 'description' => ts('Should we enable the auto-responder?'),
696 'where' => 'civicrm_mailing.auto_responder',
697 'table_name' => 'civicrm_mailing',
698 'entity' => 'Mailing',
699 'bao' => 'CRM_Mailing_BAO_Mailing',
702 'type' => 'CheckBox',
707 'name' => 'open_tracking',
708 'type' => CRM_Utils_Type
::T_BOOLEAN
,
709 'title' => ts('Track Mailing?'),
710 'description' => ts('Should we track when recipients open/read this mailing?'),
711 'where' => 'civicrm_mailing.open_tracking',
712 'table_name' => 'civicrm_mailing',
713 'entity' => 'Mailing',
714 'bao' => 'CRM_Mailing_BAO_Mailing',
719 'name' => 'is_completed',
720 'type' => CRM_Utils_Type
::T_BOOLEAN
,
721 'title' => ts('Mailing Completed'),
722 'description' => ts('Has at least one job associated with this mailing finished?'),
723 'where' => 'civicrm_mailing.is_completed',
724 'table_name' => 'civicrm_mailing',
725 'entity' => 'Mailing',
726 'bao' => 'CRM_Mailing_BAO_Mailing',
729 'type' => 'CheckBox',
733 'msg_template_id' => [
734 'name' => 'msg_template_id',
735 'type' => CRM_Utils_Type
::T_INT
,
736 'title' => ts('Mailing Message Template'),
737 'description' => ts('FK to the message template.'),
738 'where' => 'civicrm_mailing.msg_template_id',
739 'table_name' => 'civicrm_mailing',
740 'entity' => 'Mailing',
741 'bao' => 'CRM_Mailing_BAO_Mailing',
743 'FKClassName' => 'CRM_Core_DAO_MessageTemplate',
747 'name' => 'override_verp',
748 'type' => CRM_Utils_Type
::T_BOOLEAN
,
749 'title' => ts('Override Verp'),
750 'description' => ts('Overwrite the VERP address in Reply-To'),
751 'where' => 'civicrm_mailing.override_verp',
753 'table_name' => 'civicrm_mailing',
754 'entity' => 'Mailing',
755 'bao' => 'CRM_Mailing_BAO_Mailing',
758 'type' => 'CheckBox',
763 'name' => 'created_id',
764 'type' => CRM_Utils_Type
::T_INT
,
765 'title' => ts('Mailing Creator'),
766 'description' => ts('FK to Contact ID who first created this mailing'),
767 'where' => 'civicrm_mailing.created_id',
768 'table_name' => 'civicrm_mailing',
769 'entity' => 'Mailing',
770 'bao' => 'CRM_Mailing_BAO_Mailing',
772 'FKClassName' => 'CRM_Contact_DAO_Contact',
776 'name' => 'created_date',
777 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
778 'title' => ts('Mailing Created Date'),
779 'description' => ts('Date and time this mailing was created.'),
781 'where' => 'civicrm_mailing.created_date',
783 'table_name' => 'civicrm_mailing',
784 'entity' => 'Mailing',
785 'bao' => 'CRM_Mailing_BAO_Mailing',
788 'type' => 'Select Date',
789 'formatType' => 'activityDateTime',
793 'mailing_modified_date' => [
794 'name' => 'modified_date',
795 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
796 'title' => ts('Modified Date'),
797 'description' => ts('When the mailing (or closely related entity) was created or modified or deleted.'),
799 'where' => 'civicrm_mailing.modified_date',
801 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
802 'table_name' => 'civicrm_mailing',
803 'entity' => 'Mailing',
804 'bao' => 'CRM_Mailing_BAO_Mailing',
809 'name' => 'scheduled_id',
810 'type' => CRM_Utils_Type
::T_INT
,
811 'title' => ts('Scheduled By'),
812 'description' => ts('FK to Contact ID who scheduled this mailing'),
813 'where' => 'civicrm_mailing.scheduled_id',
814 'table_name' => 'civicrm_mailing',
815 'entity' => 'Mailing',
816 'bao' => 'CRM_Mailing_BAO_Mailing',
818 'FKClassName' => 'CRM_Contact_DAO_Contact',
821 'scheduled_date' => [
822 'name' => 'scheduled_date',
823 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
824 'title' => ts('Mailing Scheduled Date'),
825 'description' => ts('Date and time this mailing was scheduled.'),
827 'where' => 'civicrm_mailing.scheduled_date',
829 'table_name' => 'civicrm_mailing',
830 'entity' => 'Mailing',
831 'bao' => 'CRM_Mailing_BAO_Mailing',
834 'type' => 'Select Date',
835 'formatType' => 'activityDateTime',
840 'name' => 'approver_id',
841 'type' => CRM_Utils_Type
::T_INT
,
842 'title' => ts('Approved By'),
843 'description' => ts('FK to Contact ID who approved this mailing'),
844 'where' => 'civicrm_mailing.approver_id',
845 'table_name' => 'civicrm_mailing',
846 'entity' => 'Mailing',
847 'bao' => 'CRM_Mailing_BAO_Mailing',
849 'FKClassName' => 'CRM_Contact_DAO_Contact',
853 'name' => 'approval_date',
854 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
855 'title' => ts('Mailing Approved Date'),
856 'description' => ts('Date and time this mailing was approved.'),
858 'where' => 'civicrm_mailing.approval_date',
860 'table_name' => 'civicrm_mailing',
861 'entity' => 'Mailing',
862 'bao' => 'CRM_Mailing_BAO_Mailing',
865 'type' => 'Select Date',
866 'formatType' => 'activityDateTime',
870 'approval_status_id' => [
871 'name' => 'approval_status_id',
872 'type' => CRM_Utils_Type
::T_INT
,
873 'title' => ts('Approval Status'),
874 'description' => ts('The status of this mailing. Values: none, approved, rejected'),
875 'where' => 'civicrm_mailing.approval_status_id',
876 'table_name' => 'civicrm_mailing',
877 'entity' => 'Mailing',
878 'bao' => 'CRM_Mailing_BAO_Mailing',
883 'pseudoconstant' => [
884 'optionGroupName' => 'mail_approval_status',
885 'optionEditPath' => 'civicrm/admin/options/mail_approval_status',
890 'name' => 'approval_note',
891 'type' => CRM_Utils_Type
::T_LONGTEXT
,
892 'title' => ts('Approval Note'),
893 'description' => ts('Note behind the decision.'),
894 'where' => 'civicrm_mailing.approval_note',
895 'table_name' => 'civicrm_mailing',
896 'entity' => 'Mailing',
897 'bao' => 'CRM_Mailing_BAO_Mailing',
900 'type' => 'TextArea',
905 'name' => 'is_archived',
906 'type' => CRM_Utils_Type
::T_BOOLEAN
,
907 'title' => ts('Is Mailing Archived?'),
908 'description' => ts('Is this mailing archived?'),
909 'where' => 'civicrm_mailing.is_archived',
911 'table_name' => 'civicrm_mailing',
912 'entity' => 'Mailing',
913 'bao' => 'CRM_Mailing_BAO_Mailing',
916 'type' => 'CheckBox',
921 'name' => 'visibility',
922 'type' => CRM_Utils_Type
::T_STRING
,
923 'title' => ts('Mailing Visibility'),
924 'description' => ts('In what context(s) is the mailing contents visible (online viewing)'),
926 'size' => CRM_Utils_Type
::BIG
,
927 'where' => 'civicrm_mailing.visibility',
928 'default' => 'Public Pages',
929 'table_name' => 'civicrm_mailing',
930 'entity' => 'Mailing',
931 'bao' => 'CRM_Mailing_BAO_Mailing',
936 'pseudoconstant' => [
937 'callback' => 'CRM_Core_SelectValues::groupVisibility',
942 'name' => 'campaign_id',
943 'type' => CRM_Utils_Type
::T_INT
,
944 'title' => ts('Mailing Campaign'),
945 'description' => ts('The campaign for which this mailing has been initiated.'),
946 'where' => 'civicrm_mailing.campaign_id',
947 'table_name' => 'civicrm_mailing',
948 'entity' => 'Mailing',
949 'bao' => 'CRM_Mailing_BAO_Mailing',
951 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
955 'pseudoconstant' => [
956 'table' => 'civicrm_campaign',
958 'labelColumn' => 'title',
963 'name' => 'dedupe_email',
964 'type' => CRM_Utils_Type
::T_BOOLEAN
,
965 'title' => ts('No Duplicate emails?'),
966 'description' => ts('Remove duplicate emails?'),
967 'where' => 'civicrm_mailing.dedupe_email',
969 'table_name' => 'civicrm_mailing',
970 'entity' => 'Mailing',
971 'bao' => 'CRM_Mailing_BAO_Mailing',
974 'type' => 'CheckBox',
978 'sms_provider_id' => [
979 'name' => 'sms_provider_id',
980 'type' => CRM_Utils_Type
::T_INT
,
981 'title' => ts('Mailing SMS Provider'),
982 'where' => 'civicrm_mailing.sms_provider_id',
983 'table_name' => 'civicrm_mailing',
984 'entity' => 'Mailing',
985 'bao' => 'CRM_Mailing_BAO_Mailing',
987 'FKClassName' => 'CRM_SMS_DAO_Provider',
995 'type' => CRM_Utils_Type
::T_STRING
,
996 'title' => ts('Mailing Hash'),
997 'description' => ts('Key for validating requests related to this mailing.'),
999 'size' => CRM_Utils_Type
::TWELVE
,
1000 'where' => 'civicrm_mailing.hash',
1001 'table_name' => 'civicrm_mailing',
1002 'entity' => 'Mailing',
1003 'bao' => 'CRM_Mailing_BAO_Mailing',
1007 'location_type_id' => [
1008 'name' => 'location_type_id',
1009 'type' => CRM_Utils_Type
::T_INT
,
1010 'title' => ts('Location Type'),
1011 'description' => ts('With email_selection_method, determines which email address to use'),
1012 'where' => 'civicrm_mailing.location_type_id',
1013 'table_name' => 'civicrm_mailing',
1014 'entity' => 'Mailing',
1015 'bao' => 'CRM_Mailing_BAO_Mailing',
1017 'FKClassName' => 'CRM_Core_DAO_LocationType',
1018 'pseudoconstant' => [
1019 'table' => 'civicrm_location_type',
1020 'keyColumn' => 'id',
1021 'labelColumn' => 'display_name',
1025 'email_selection_method' => [
1026 'name' => 'email_selection_method',
1027 'type' => CRM_Utils_Type
::T_STRING
,
1028 'title' => ts('Email Selection Method'),
1029 'description' => ts('With location_type_id, determine how to choose the email address to use.'),
1031 'size' => CRM_Utils_Type
::MEDIUM
,
1032 'where' => 'civicrm_mailing.email_selection_method',
1033 'default' => 'automatic',
1034 'table_name' => 'civicrm_mailing',
1035 'entity' => 'Mailing',
1036 'bao' => 'CRM_Mailing_BAO_Mailing',
1038 'pseudoconstant' => [
1039 'callback' => 'CRM_Core_SelectValues::emailSelectMethods',
1044 'name' => 'language',
1045 'type' => CRM_Utils_Type
::T_STRING
,
1046 'title' => ts('Mailing Language'),
1047 'description' => ts('Language of the content of the mailing. Useful for tokens.'),
1049 'size' => CRM_Utils_Type
::SIX
,
1050 'where' => 'civicrm_mailing.language',
1051 'table_name' => 'civicrm_mailing',
1052 'entity' => 'Mailing',
1053 'bao' => 'CRM_Mailing_BAO_Mailing',
1058 'pseudoconstant' => [
1059 'optionGroupName' => 'languages',
1060 'keyColumn' => 'name',
1061 'optionEditPath' => 'civicrm/admin/options/languages',
1066 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
1068 return Civi
::$statics[__CLASS__
]['fields'];
1072 * Return a mapping from field-name to the corresponding key (as used in fields()).
1075 * Array(string $name => string $uniqueName).
1077 public static function &fieldKeys() {
1078 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
1079 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
1081 return Civi
::$statics[__CLASS__
]['fieldKeys'];
1085 * Returns the names of this table
1089 public static function getTableName() {
1090 return self
::$_tableName;
1094 * Returns if this table needs to be logged
1098 public function getLog() {
1103 * Returns the list of fields that can be imported
1105 * @param bool $prefix
1109 public static function &import($prefix = FALSE) {
1110 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing', $prefix, []);
1115 * Returns the list of fields that can be exported
1117 * @param bool $prefix
1121 public static function &export($prefix = FALSE) {
1122 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing', $prefix, []);
1127 * Returns the list of indices
1129 * @param bool $localize
1133 public static function indices($localize = TRUE) {
1136 'name' => 'index_hash',
1140 'localizable' => FALSE,
1141 'sig' => 'civicrm_mailing::0::hash',
1144 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;