Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Generic, expirable, multi-use invitations

I'm not sure how feasible this is, but I've been trying to figure out how to allow generic invites that multiple people can use up to either a date or number of uses even. This is needed for me, as I have a invite-only community I am creating, and need to send an initial one or few generic invites to get it started. I've been looking at plugins such as Bulk Invite, but it's all a bit new to me right now.

Any tips or pointers would be appreciated!

Comments

  • Options
    hgtonighthgtonight ∞ · New Moderator

    You can do it.

    1. Create your mass invitation model that has an expiration date and/or use count. It should be able to validate whether or not a code can be used.
    2. Hook into the Entry controller's Register event and check for a valid code using your model. If the code is still valid, save switch the registration method temporarily to basic and also save some data to the controller so you know the code was valid
    3. Hook into the Entry controller's RegisterValidation event and check for the data you set on the controller. If it exists, add some a hidden field to the form
    4. Hook into the UserModel's AfterInsertFields event and check for the hidden field data. If it exists, update your mass invitation model to reflect a use.

    I believe this is the minimal work necessary to offer that feature. You would also need to make an admin GUI to manage the mass invitation codes if you don't want to manage everything in the db.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    LincLinc Detroit Admin

    @Luke FYI, we've laid some groundwork for doing this in 2.3. They went into master March 17-19 if you wanna take a peek.

  • Options
    LukeLuke New
    edited May 2014

    @Linc said:
    Luke FYI, we've laid some groundwork for doing this in 2.3. They went into master March 17-19 if you wanna take a peek.

    Is it planned to offer exactly what I am looking for, or is this just something plugin developers can utilize and expand on?

  • Options
    LincLinc Detroit Admin
    via Email
    I think invites belong in core as a generic feature, but I can't tell you with certainty the full thing will be in 2.3.
Sign In or Register to comment.