Using s2Member Pro Import would be appropriate if I had a one-time batch of people to invite. But my situation is different. At various times, an event will happen that triggers an invitation, and I want to automate this as much as possible.
Yes, there's always a risk that an uninvited guest will find the free registration form, but I think I can at least keep search engines from finding it.
I think I found a solution based on some information in
this post. I'll use a special template for the free registration form, and I'll put this code near the top of the template:
- Code: Select all
if ($_GET['email']) {
if (!is_array($_POST))
$_POST = array();
if (!is_array($_POST['s2member_pro_paypal_registration']))
$_POST['s2member_pro_paypal_registration'] = array();
if (!is_array($_POST['s2member_pro_paypal_registration']['custom_fields']))
$_POST['s2member_pro_paypal_registration']['custom_fields'] = array();
$_POST['s2member_pro_paypal_registration']['first_name'] = $_GET['fname'];
$_POST['s2member_pro_paypal_registration']['last_name'] = $_GET['lname'];
$_POST['s2member_pro_paypal_registration']['email'] = $_GET['email'];
$_POST['s2member_pro_paypal_registration']['custom_fields']['key'] = $_GET['key'];
}
This seems to be effective in getting the fields prefilled in the form.