Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add membership
<?php
class CRM_CivirulesActions_EA_Membership_Add extends CRM_Civirules_Action {
public function processAction(CRM_Civirules_TriggerData_TriggerData $triggerData) {
$contactId = $triggerData->getContactId();
$todaysDate = date('Y-m-d');
$params = array(
'debug' => 1,
'contact_id' => $contactId,
'membership_type_id' => 3,
'start_date' => $todaysDate,
'source' => 'Event Sign Up',
'status_id' => 1
);
/* Set membership */
$result = civicrm_api3('Membership', 'create', $params);
public function getExtraDataInputUrl($ruleActionId) {
return FALSE;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.