rcp_successful_registration

Runs after a user signs up for a membership level. This triggers during new signups, manual renewals, upgrades, and downgrades. It does not trigger for automatic renewals.

Parameters:

  • $member - RCP_Member object.
  • $customer - RCP_Customer object.
  • $membership - RCP_Membership object.

Example:

/**
 * Send extra follow up email to new members who sign up for level ID #1, #2, or #3.
 * 
 * @param RCP_Member $member 
 * @param RCP_Customer $customer
 * @param RCP_Membership $membership
 * 
 * @return void
 */
function ag_rcp_after_registration( $member, $customer, $membership ) {

	// Array of level IDs we want to execute code for.
	$membership_levels_to_check = array( 1, 2, 3 );  // Change these ID numbers.
	
	// Bail if they don't have one of these level IDs.
	if ( ! in_array( $membership->get_object_id(), $membership_levels_to_check ) ) {
		return;
	}
	
	// Send an extra follow up email.
	$subject = __( 'Requesting extra information', 'rcp' );
	$message = __( 'Include your email message here.', 'rcp' );
	
	$emails = new RCP_Emails;
	$emails->member_id = $member->ID;
	$emails->send( $member->user_email, $subject, $message );

}

add_action( 'rcp_successful_registration', 'ag_rcp_after_registration', 10, 3 );