Invitation Code Content Access - Creating Codes - From CSV File
Creating Code From a CSV File
Head to Admin Dashboard → Invitation Code Content Access → Invitation codes to create codes.
In this screen you can manage your current codes and add new ones.
TIP: Updating Codes
Every code can be fully edited after it's been created. That means editing expiration date, sharing type and even the code itself!
While this can be useful, be mindful not to invalidate your codes.
Click Import Codes From CSV.
Add Invitation Code (From CSV File)
TIP: Download File Example
Speed up the import process by using a sample file. Download CSV example file
This method generates multiple invitation codes at once based on a CSV file.
You can set:
- Session - Write down the session name (for internal use only)
- Note - Add a note (can only be seen by the admin)
- Valid from date - Leave empty to activate the code right away (respects the website time zone)
- Expiration date - Leave empty to never expire (respects the website time zone)
- No of usages - Set a usage limit (empty means unlimited)
- Expire code some time after first login - Expires the account a certain amount of time after the first time the user logs in.
Enter the amount of hours. 1 is one hour, 0.5 is half an hour (30 minutes) etc. The default value is 1
- Expire code by time online - Expires the account after the user spends a certain amount of time on your site.
Enter the amount of hours. 1 is one hour, 0.5 is half an hour (30 minutes) etc. The default value is 1.
- Sharing Type - Choose between a code type. Learn more.
- Content (URL) - Set the allowed URLs (use * to indicate any subdirectory. For instance, example.com/*)
- File - Choose file to be locked.
- Notification email - An email will be sent to this address once the code is imported
What is a CSV File
A .csv (comma separated values) file is a format that can be opened by most spreadsheet software. Sample table:
CSV File Specifications
The CSV file must follow some specifications:
- Has to be UTF-8 encoded
- Can include the columns
- code - can't be empty
- expiration_date - Use the / separator for mm/dd/yyyy, and - or . for dd-mm-yyyy format.
- Proper 12/30/2020 | Incorrect 30/12/2020
- Proper 30.12.2020 | Incorrect 12.30.2020
- Proper 30-12-2020 | Incorrect 12-30-2020
- sharing_type - can be
- "content" - For URLs
- "scontent" - For short content
- "file" - For files
- "efile" - For external files
Note on sharing_type, allow_url and sharing_file fields
The sharing_type fields determines what the code will restrict. That way, depending on it, other fields will be more relevant.
- if sharing_type = "content" => allow_url = "http://some-url.com" (Restricted URL)
- if sharing_type = "scontent" => no need for URL
- if sharing_type = "file" => sharing_file = "9137" (file ID)
- if sharing_type = "efile" => sharing_file = "http://url-to-external-file.com"
Fields with commas
If a field contains commas, it has to be enclosed by quotes. This ensures the fields don't get mixed. For instance:
- Incorrect - Admin note, viewable only to the admin
- Proper - "Admin note, viewable only to the admin"
In the plugin screen, you can:
- Select an internal name for the sequence (only shown to the admin)
- Add a note (can only be seen by the admin)
- Set the expiration date
- Set a usage limit
- Set the allowed URLs
These values will be applied only to fields that are empty in the CSV file. If a row has any assigned value to it, the value in the CSV file will be applied.
The following CSV file will generate three codes:
- cmicca-sample-1 - All fields will be imported from the CSV file
- cmicca-sample-2 - Expiration date and time will come from the plugin settings because they are empty
- cmicca-sample-3 - All fields will come from the plugin settings because they are empty
- Fourth row won't be imported, since there's no code