PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

free registration with fields prefilled from email

s2Member Plugin. A Membership plugin for WordPress®.

free registration with fields prefilled from email

Postby svillee » August 1st, 2011, 4:27 pm

I have a WordPress site with s2Member Pro installed. I'd like to allow free registrations, but only through a link that would be included in an "invitation" email. When the user clicks on this link, it would take him to a page containing the Free Registration Form, but with the first three fields (First Name, Last Name, Email Address) prefilled with values given in the email. I'd also like a Custom Registration Field, say "Key", prefilled with a value given in the email. Ideally, I'd like this "Key" field to be hidden on the form, but I'd settle for it being visible and prefilled.

So the link in the invitation email might look something like this:

Code: Select all
http://oursite.com/invited-free-registration/?fname=John&lname=Smith&email=jsmith%40gmail.com&key=31416


Is the s2Member-Pro-PayPal-Form shortcode flexible enough to allow this? Thanks in advance for any help.
User avatar
svillee
Registered User
Registered User
 
Posts: 10
Joined: August 1, 2011

Re: free registration with fields prefilled from email

Postby Cristián Lávaque » August 1st, 2011, 10:32 pm

I seem to remember Jason mentioning in the past how one could pass values in the URL that'd prefill the form, but I'm not being able to find it, so it may just have been a dream I had. :P

Since you'd be inviting them, instead of having a free registration form up there where someone that finds it could use it although he wasn't invited...

You already have their names, email address and keys, why not just create their accounts using s2Member Pro's Import tool and then send them the email saying they just need to generate the password to activate it? viewtopic.php?f=4&t=1163&p=9032#p9032

Would that work?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: free registration with fields prefilled from email

Postby svillee » August 2nd, 2011, 9:31 am

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.
User avatar
svillee
Registered User
Registered User
 
Posts: 10
Joined: August 1, 2011

Re: free registration with fields prefilled from email

Postby Cristián Lávaque » August 2nd, 2011, 11:27 pm

Great!

That was the thread with Jason's post I remembered. viewtopic.php?f=4&t=3029&p=11814#p11814 Thanks for finding it. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: free registration with fields prefilled from email

Postby bitofgrace » October 6th, 2011, 4:23 pm

Svillee just wondering if you have any recommendations on how to hide the free registration form - so that only your invited guests are reaching it?

Sounds like i'll be using this same method to get around the penny payment in pre-registrations.

-grace
User avatar
bitofgrace
Registered User
Registered User
 
Posts: 64
Joined: September 8, 2011

Re: free registration with fields prefilled from email

Postby svillee » October 7th, 2011, 12:37 pm

I just put the free registration form on a page whose URL is hard to guess, and made sure no menu refers to that page. So only people who have received the appropriate email should be able to reach it.

If a hacker somehow guesses the URL and does an unauthorized free registration, the admin can just delete that user.
User avatar
svillee
Registered User
Registered User
 
Posts: 10
Joined: August 1, 2011

Re: free registration with fields prefilled from email

Postby bitofgrace » October 7th, 2011, 12:42 pm

Ahh ok-
I've gone a step further and added it as a disallow on my robots.txt and noindexing on my htaccess as well. Really don't want folks finding it via search engine results :/

-grace
User avatar
bitofgrace
Registered User
Registered User
 
Posts: 64
Joined: September 8, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 3 guests

cron