gianmarcoaltieri
gianmarcoaltieri

Reputation: 5

Invitation code and users database in Wordpress

I need your precious help. I'm working hard on organizing a contest linked to a wordpress site. That's the way it should work:

  1. There's a contest. The user have to register as new user in WP (there's also the Facebook Connect/Open Graph) to enter the contest.
  2. When a new user register himself, the system sends him an email: "Congratulations! You are a new user. Here there are some invitation codes (or links) to invite your friends. If they register here with the invitation code (or link), you'll receive a gift".

How can i do this workflow? I need to generate some codes (or links) every time a new user enter the WP site and assign them (linking those data to the users). I need to know if a new user (called B) comes to my site thanks to another user (called A), in order to give to A a gift.

Thank you guys.

Upvotes: 0

Views: 2311

Answers (2)

CreativeMinds
CreativeMinds

Reputation: 1

We created a plug called Cm Invitation Codes that allows you to assign codes per groups. This way you can know from which site each registration is coming and control also the number of user registration from a specific site. Try CM Invitation Code in WordPress Plugin Directory http://wordpress.org/extend/plugins/cm-invitation-codes/

Upvotes: 0

zuzuleinen
zuzuleinen

Reputation: 2634

You must make a frontend registration. Then, after user is registered you send him an email like www.yourdomain.com/register?uid=his_id(link to te registration form with his id as a parameter).

The when he passes the link to his friend B, friend B is registering and you check if there's a $_GET['uid']. It yes you add him a meta containing the id.

  1. To make a front-end registeration, you should check this article.

  2. For mail sending you could use wp_mail() function.

  3. For passing params in the url and accessing you must be familiar with $_GET

  4. For adding a meta for an user you must use the add_user_meta(). function.

The above steps are not necessarily difficult if you know basic PHP and willing to learn from Wordpress codex.

Upvotes: 1

Related Questions