<p>If I'm following you correctly then it sounds completely doable.</p>

<p>You'd need to create a Craft <a href="http://buildwithcraft.com/docs/plugins/introduction" rel="nofollow">plugin</a> that generated the 2,000 codes to use and save them somewhere (probably the database).</p>

<p>Then you'd write a <a href="http://buildwithcraft.com/docs/templating/user-registration-form" rel="nofollow">registration form</a> for the front-end of your site that posted to your plugin's <a href="http://buildwithcraft.com/docs/plugins/controllers" rel="nofollow">controller</a> and passing along any registration code they've entered.  Your plugin would then validate that code against the database and call Craft's <a href="http://buildwithcraft.com/classreference/services/UsersService#saveUser-detail" rel="nofollow">UsersService->saveUser()</a> if it is valid, otherwise return an appropriate error.</p>

CC BY-SA 3.0
2015-09-11T15:54:29.813Z
2015-09-11T15:54:29.813Z
Brad Bell
<p>I started a project in Craft, but I think I need a plugin. The idea is to generate 2,000 registration codes for a subscription in the site and the only way to access the site is to register using any of the 2,000 codes that are printed on cards. Is this possible?</p>

<users><plugins>
Subscribe plugin
# Subscribe plugin

(Asked by: username_0 on 2015-09-11)

I started a project in Craft, but I think I need a plugin. The idea is to generate 2,000 registration codes for a subscription in the site and the only way to access the site is to register using any of the 2,000 codes that are printed on cards. Is this possible?

**Tags:** users, plugins


---

## 1 answers

### Answer by username_1 on 2015-09-11. Score: 1

If I'm following you correctly then it sounds completely doable.

You'd need to create a Craft [plugin](http://buildwithcraft.com/docs/plugins/introduction) that generated the 2,000 codes to use and save them somewhere (probably the database).

Then you'd write a [registration form](http://buildwithcraft.com/docs/templating/user-registration-form) for the front-end of your site that posted to your plugin's [controller](http://buildwithcraft.com/docs/plugins/controllers) and passing along any registration code they've entered. Your plugin would then validate that code against the database and call Craft's [UsersService->saveUser()](http://buildwithcraft.com/classreference/services/UsersService#saveUser-detail) if it is valid, otherwise return an appropriate error.


---

