## Overview
Let users invite others to join an instance via //invite link//, like on Mastodon.
## Background
Good for when registration is closed, or other private instances.
### Users
All users on a multi-user instance.
## Implementation
Create new database table `userinvites` that holds invite information:
| id | owner_id | max_uses | expires | active |
| --- | --- | --- | --- | --- |
| abc123 | 1 | 10 | 2019-01-01 | 1 |
| def456 | 1 | NULL | NULL | 1 |
### Write.as
This would be a useful foundation for any kind of affiliate / referral program we decide to create in the future. See {T558}.
### User sign ups
For T558 and future moderation tools on #write_freely, we should keep track of which users sign up from which invite links. Add a new database table `usersinvited`:
| invite_id | user_id |
| --- | --- |
| abc123 | 4 |
| abc123 | 18 |
| def456 | 21 |