lingthio/Flask-User — pull request #52 by neurosnap (2014-12-09 19:52:38+00:00)
Title: User invite

This PR allows users to invite other users to the site via email. With this PR comes with a view settings as well as a new model class to deal with user invitations.

Example model:
```
class UserInvitation(db.Model):
__tablename__ = 'user_invite'
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(255), nullable=False)
# save the user of the invitee
invited_by_user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
# token used for registration page to identify user registering
token = db.Column(db.String(100), nullable=False, server_default='')
```

The following settings must be active for this functionality to work properly:
USER_ENABLE_EMAIL = True
USER_ENABLE_REGISTER = True
USER_ENABLE_INVITATION = True

The default route is: `/user/invite`. To change the default route, simply set `USER_INVITE_URL`.

The default email template is /templates/emails/invite which is set using `USER_INVITE_EMAIL_TEMPLATE`.