Moodle plugins directory: Invitation | Moodle.org
Invitation
Enrolment ::: enrol_invitation
Maintained by Michael Milette
The Invitation Enrolment Moodle Plugin is a powerful tool for course instructors that simplifies the enrolment process by allowing instructors to send personalized email invitations with a unique token. This plugin offers control over who can use the invitation, tracks past invitations, and allows for resending or revoking invitations. It also supports inviting users even if they are not yet registered on your Moodle LMS site and limiting the lifespan of the invitation.
Latest release:
561 sites
590 downloads
56 fans
Current versions available: 2
Invitation Enrolment Moodle Plugin
The Invitation enrollment plug-in for Moodle LMS allows instructors to invite students to their course and site, and grant necessary access and role to them. The invitation is sent via email and contains a link with an unique, one-time use invitation token.
When the user clicks on the link and logs into the site, (s)he is automatically enrolled into the course and the invitation link is marked as used.
Features
The benefits of using this plug-in over an enrollment key are:
- You can control who can use the invitation.
- You can include a personalized message in the invitation.
- You can see a history of past invitations and their status.
- You can also see who used an invitation or which ones are expired.
- You can resend expired invitations or send reminder invitations.
- You can revoke the invitation if has not yet been accepted.
- You can invite users who do not yet have an account. However, they will need to create an account before they can accept the invitation.
- You can limit invitations to users with existing accounts.
- You can limit the lifespan of the invitation (e.g. 2 weeks)
Support
Invitation enrolment is a contributed plugin. You are welcome to submit Pull Requests on Github and to report issues. However, free support is not guaranteed.
Installation
See README.md for information on how to install and configure the plugin.
Useful links
Contributors
Michael Milette (Lead maintainer)
Jérôme Mouneyrac: Original maintainer
Please login to view contributors details and/or to contact them
-Derek
The problem is in the function leftinvitationfortoday(), the query to get the number of invitations sent does not take into account the specific course you are looking for, so if you have sent 4 invitations for the course 1, and the course 2 allows you to send only 5 invitations, the number of available invitations for the course 2 today is only one. It could be fixed adding a new clause:
//$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 ', array($onedayearlier));
$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 AND courseid = ?', array($onedayearlier,$courseid));
The problem is in the function leftinvitationfortoday(), the query to get the number of invitations sent does not take into account the specific course you are looking for, so if you have sent 4 invitations for the course 1, and the course 2 allows you to send only 5 invitations, the number of available invitations for the course 2 today is only one. It could be fixed adding a new clause:
//$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 ', array($onedayearlier));
$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 AND courseid = ?', array($onedayearlier,$courseid));
The problem is in the function leftinvitationfortoday(), the query to get the number of invitations sent does not take into account the specific course you are looking for, so if you have sent 4 invitations for the course 1, and the course 2 allows you to send only 5 invitations, the number of available invitations for the course 2 today is only one. It could be fixed adding a new clause:
//$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 ', array($onedayearlier));
$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 AND courseid = ?', array($onedayearlier,$courseid));
The problem is in the function leftinvitationfortoday(), the query to get the number of invitations sent does not take into account the specific course you are looking for, so if you have sent 4 invitations for the course 1, and the course 2 allows you to send only 5 invitations, the number of available invitations for the course 2 today is only one. It could be fixed adding a new clause:
//$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 ', array($onedayearlier));
$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 AND courseid = ?', array($onedayearlier,$courseid));
The problem is in the function leftinvitationfortoday(), the query to get the number of invitations sent does not take into account the specific course you are looking for, so if you have sent 4 invitations for the course 1, and the course 2 allows you to send only 5 invitations, the number of available invitations for the course 2 today is only one. It could be fixed adding a new clause:
//$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 ', array($onedayearlier));
$sentinvitations = $DB->get_records_select('enrol_invitation', 'timesent > ? AND tokenused = 0 AND courseid = ?', array($onedayearlier,$courseid));
He is probably not watching the notifications from here. Maybe a PM will work, or a message on GITHUB with a bug report . . .
-Derek
Second, to Carina Martinez. I developed a small script, so a teacher can copy and paste the entire list of the students' emails to a specially designed window. Then you click on a button under this text window and the script populates all emails in the separate text strings designed by Jérôme Mouneyrac. Here is the script that you need to insert into invitation.php file (before "echo html_writer::tag('div', get_string('invitationpagehelp', 'enrol_invitation', $invitationleft), array('class' => 'invitationpagehelp'));" and after the line "if ($invitationleft > 0) {")
//Eugene edit: add
echo '
Paste a column of the class participants\' emails from Excel here:
/enter one email address (and nothing else!) per line always followed by Enter/onclick="if(document.getElementById(\'emailist\').value.split(\'\n\').length-1>',$invitationleft,')
{alert(\'Too many emails! Reduce please to ',$invitationleft,'.\');} else {';
for ($i = 1; $i <= $invitationleft; $i += 1) {
echo 'if (document.getElementById(\'emailist\').value.split(\'\n\').length>',$i-1,')
{document.getElementById(\'id_email',$i,'\').value=document.getElementById(\'emailist\').value.split(\'\n\')[',$i-1,'];}';
}
echo '}
"
>
';//Eugene edit: add
////Eugene edit: end
Third, to Japheth Leung. My investigation shows that the reason of why the plugin stopped working after Moodle2.5.1 is because they change the function "email_to_user()". My successful way around of this problem is to replace the new script in Moodle2.7.1 of the mail_to_user() function with the old email_to_user() function that I took from Moodle2.5.1. The script defining the email_to_user() function is listed in the moodle/lib/moodlelib.php file -- just search for the text "function email_to_user". The plugin works fine with this roundabout and so far I don't see negative consequences of my change.
Your contribution is much appreciated.
Working just fine on: Moodle 2.6.5 (Build: 20140908)