APIv4 - Add MailingGroup API
authorColeman Watts <coleman@civicrm.org>
Sat, 19 Feb 2022 17:42:33 +0000 (12:42 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 19 Feb 2022 17:42:33 +0000 (12:42 -0500)
CRM/Mailing/BAO/Mailing.php
Civi/Api4/MailingGroup.php [new file with mode: 0644]

index 93592c8e014599e4603edef3f1d8977721275995..7f065f0af8bc4fcdda5612e4cc7fc1827558bccf 100644 (file)
@@ -3014,8 +3014,16 @@ ORDER BY civicrm_mailing.name";
    */
   public static function mailingGroupEntityTables() {
     return [
-      CRM_Contact_BAO_Group::getTableName() => 'Group',
-      CRM_Mailing_BAO_Mailing::getTableName() => 'Mailing',
+      [
+        'id' => CRM_Contact_BAO_Group::getTableName(),
+        'name' => 'Group',
+        'label' => ts('Group'),
+      ],
+      [
+        'id' => CRM_Mailing_BAO_Mailing::getTableName(),
+        'name' => 'Mailing',
+        'label' => ts('Mailing'),
+      ],
     ];
   }
 
diff --git a/Civi/Api4/MailingGroup.php b/Civi/Api4/MailingGroup.php
new file mode 100644 (file)
index 0000000..5f69b5f
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC. All rights reserved.                        |
+ |                                                                    |
+ | This work is published under the GNU AGPLv3 license with some      |
+ | permitted exceptions and without any warranty. For full license    |
+ | and copyright information, see https://civicrm.org/licensing       |
+ +--------------------------------------------------------------------+
+ */
+namespace Civi\Api4;
+
+/**
+ * Mailing groups are the groups or mailings included or excluded from mailing recipients.
+ *
+ * @searchable none
+ *
+ * @see https://docs.civicrm.org/user/en/latest/email/what-is-civimail/
+ * @since 5.48
+ * @package Civi\Api4
+ */
+class MailingGroup extends Generic\DAOEntity {
+
+}