function webform_civicrm_mailer_event_subscribe in Webform CiviCRM Integration 6
CiviCRM group subscription API wrapper Mimics the functionality of api V2 for CiviCRM versions prior to 3.3
Parameters
array $params:
Return value
array
1 call to webform_civicrm_mailer_event_subscribe()
- webform_civicrm_contact_match in ./
webform_civicrm_utils.inc - Create or update CiviCRM contact Called by both presave and insert webform hooks in order to handle the optional contact_id field correctly
File
- ./
webform_civicrm_utils.inc, line 648 - Webform CiviCRM module's utility functions.
Code
function webform_civicrm_mailer_event_subscribe($params) {
require_once 'CRM/Utils/System.php';
$civicrm_version = CRM_Utils_System::version();
if ($civicrm_version >= 3.3) {
require_once 'api/v2/Mailer.php';
return civicrm_mailer_event_subscribe($params);
}
else {
require_once 'api/Mailer.php';
return crm_mailer_event_subscribe($params['email'], $params['group_id']);
}
}