API Notifications - Add User to additional database table

I was told that API notifications might be the route for this, but here is my issue.

I have a plugin that has 2 different registration forms, the two forms are for two different groups of people. However, when they sign up they get the subscriber role, both of them… but they have different access based on some tables in the database.

User1 signs up and gets put into both the wp_users table and the “custom_table1” which identifies that person.
User2 signs up and gets put into both the wp_users table and the “custom_table2” which identifies that person.

So, I want to be able to charge User1 a monthly fee, that is why i want to use s2member. How can I use the paypal pro form and tell s2member to add that user to a specific table in my database?

That is a good explanation! Yes, create notification URL with all your need info, and let it runs some custom function, where you save the users to whatever custom table is need, based on the incoming info.

Thanks for your reply @krumch Although I am kind of a noob to this… do you have an example on how this might be done? Appreciate your time!

Also, I think I know what I want to do but i am just not sure how to write it. Any help is always appreciated.

// Insert to table_agency_profile
$wpdb->query($wpdb->prepare(“INSERT INTO “.table_agency_profile.”
(
ProfileContactDisplay,
ProfileContactNameFirst,
ProfileContactNameLast,
ProfileGender,
ProfileContactEmail,
ProfileIsActive,
ProfileUserLinked,
ProfileType,
ProfileGallery
)
VALUES(%s,%s,%s,%s,%s,%s,%s,%s,%s)”,
$profile_contact_display,
$first_name,
$last_name,
$ProfileGender,
$user_email,
$profileactive,
$new_user,
$new_user_type,
$profile_gallery
));

		$id = $wpdb->insert_id;
		$NewProfileID = $id;
		//Update and set ProfileUserLinked,ProfileGallery and ProfileContactDisplay with the ProfileID
		if($rb_agency_option_profilenaming == 3){
			$update = $wpdb->query("UPDATE " . table_agency_profile . " SET ProfileGallery='ID-" . $id . "', ProfileContactDisplay='ID-" . $id . "' WHERE ProfileID='" . $id . "'");
			$profile_gallery = "ID-".$id;
			rb_agency_createdir($profile_gallery);
		}
		add_user_meta( $new_user, 'user_profile_id', $new_user);

		//Custom Fields
		$arr = array();

		foreach($_POST as $key => $value) {
			if ((substr($key, 0, 15) == "ProfileCustomID") && (isset($value) && !empty($value))) {
				$ProfileCustomID = substr($key, 15);
				if(is_array($value)){
					$value =  implode(",",$value);
				}
				//format: _ID|value|_ID|value|_ID|value|
				if(!empty($value)){
					$arr[$ProfileCustomID] = $value;
				}
			}
		}
		$arr["new"] = true;
		$arr["step1"] = true;
		$arr["step2"] = true;
		$arr["step3"] = true;
		add_user_meta($new_user, 'rb_agency_new_registeredUser',$arr);

		// Log them in if no confirmation required.
		if ($rb_agencyinteract_option_registerapproval == 1) { // automatically approval

				// Notify admin and user
				rb_new_user_notification($new_user,$user_pass);

		} else { // manually approval

					// Notify admin and user
					rb_new_user_notification($new_user,$user_pass);
		}



	}

Read at “s2Member -> API / Notifications”, there is lot of info.

I did read through it. I dont code though, so I guess I am not sure. But thanks…