3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * APIv3 functions for registering/processing mailing group events.
32 * @package CiviCRM_APIv3
36 * Declare deprecated functions.
38 * @deprecated api notice
40 * to indicate this entire api entity is deprecated
42 function _civicrm_api3_mailing_group_deprecation() {
43 $message = 'This action is deprecated. Use the mailing_event API instead.';
45 'event_unsubscribe' => $message,
46 'event_domain_unsubscribe' => $message,
47 'event_resubscribe' => $message,
48 'event_subscribe' => $message,
53 * Handle an unsubscribe event.
57 * @param array $params
61 function civicrm_api3_mailing_group_event_unsubscribe($params) {
62 return civicrm_api('mailing_event_unsubscribe', 'create', $params);
66 * Handle a site-level unsubscribe event.
70 * @param array $params
74 function civicrm_api3_mailing_group_event_domain_unsubscribe($params) {
75 $params['org_unsubscribe'] = 1;
76 return civicrm_api('mailing_event_unsubscribe', 'create', $params);
80 * Handle a re-subscription event.
84 * @param array $params
88 function civicrm_api3_mailing_group_event_resubscribe($params) {
89 return civicrm_api('mailing_event_resubscribe', 'create', $params);
93 * Handle a subscription event.
97 * @param array $params
101 function civicrm_api3_mailing_group_event_subscribe($params) {
102 return civicrm_api('mailing_event_subscribe', 'create', $params);
106 * Create mailing group.
108 * @param array $params
111 * @throws \API_Exception
113 function civicrm_api3_mailing_group_create($params) {
114 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
120 * @param array $params
124 function civicrm_api3_mailing_group_get($params) {
125 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
129 * Delete mailing group.
131 * @param array $params
134 * @throws \API_Exception
136 function civicrm_api3_mailing_group_delete($params) {
137 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);