Created
July 31, 2018 05:34
-
-
Save jimmy-tdr/6818c315ce44f7dda79778751a4be1be to your computer and use it in GitHub Desktop.
add membership
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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