3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
14 * APIv3 functions for registering/processing mailing group events.
16 * @package CiviCRM_APIv3
20 * Handle a confirm event.
22 * @param array $params
23 * name/value pairs to insert in new 'survey'
29 function civicrm_api3_mailing_event_confirm_create($params) {
31 $contact_id = $params['contact_id'];
32 $subscribe_id = $params['subscribe_id'];
33 $hash = $params['hash'];
35 $confirm = CRM_Mailing_Event_BAO_Confirm
::confirm($contact_id, $subscribe_id, $hash) !== FALSE;
38 throw new Exception('Confirmation failed');
40 return civicrm_api3_create_success($params);
44 * Adjust Metadata for Create action.
46 * The metadata is used for setting defaults, documentation & validation.
48 * @param array $params
49 * Array of parameters determined by getfields.
51 function _civicrm_api3_mailing_event_confirm_create_spec(&$params) {
52 $params['contact_id'] = [
54 'title' => 'Contact ID',
55 'type' => CRM_Utils_Type
::T_INT
,
57 $params['subscribe_id'] = [
59 'title' => 'Subscribe Event ID',
60 'type' => CRM_Utils_Type
::T_INT
,
65 'type' => CRM_Utils_Type
::T_STRING
,