Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46886

We really must send users a notification message before they are unenrolled due to inactivity

XMLWordPrintable

    • MOODLE_27_STABLE, MOODLE_31_STABLE, MOODLE_37_STABLE, MOODLE_401_STABLE, MOODLE_404_STABLE
    • MOODLE_404_STABLE
    • MDL-46886-main
    • Hide

      Setup requirement:

      1. The testing needs an email testing tool like maiplit (https://github.com/axllent/mailpit). 
        Do not forget to set SMTP Outgoing mail configuration in your site admin by specifying the SMTP hosts with your email testing tool. Mailpit uses 0.0.0.0:1025
      2. Ensure to Specify the "Path to PHP CLI". in the Site Admin > Server > System paths

      Testing:

      1. Log in as admin
      2. Create a course
      3. On the course page, navigate to Participants.
      4. Click the Enrolled Users dropdown
      5. Select Enrolment Methods
      6. Enable The Self enrolment by clicking the eye icon
      7. And then click the gear/edit icon
      8. Disable the "Enrolment duration".
      9. At the "Notify before enrolment expires" dropdown. Select "Teacher and Enrolled user".
      10. At the "Notification threshold". Set 1 day.
      11. At the "Unenrol inactive after" dropdown. Select 7 days.
      12. Click the Save changes button
      13. Logout
      14. log in as a student
      15. Navigate the course
      16. Click the Enrol me button
      17. Logout 
      18. Log in as admin
      19. Navigate the course
      20. Navigate to the Participants
      21. Verify that the student is on the list.
      22. Change your local OS date time to the upcoming 7 days.
      23. Navigate to Site Admin > Server > Tasks > Scheduled tasks
      24. At the "Self enrolment send expiry notifications task", click the "Run now" link.
      25. You will see confirmation dialogue. Click "Run now".
      26. Verify that there is no error message in the output.
      27. Open the Mailpit in the browser
      28. Verify there is a new email with the "Self enrolment expiry notification" subject with the body:

      Hi Max Lewis,
       
      Your enrolment in the course Test 1 expires on Thursday, 7 March 2024, 3:46 AM as you have not visited it in the last 7 days. This means that you will no longer have access to the course.
       
      To keep your enrolment active, simply log in and visit Test 1 before Thursday, 7 March 2024, 3:46 AM. 
      

      Max Lewis = Student's name
      Test 1 = Course name

      29. Verify that the last course name is clickable and it will navigate user to the course page.
      30. Change back your local OS date time to the current time.

      Testing Expiring manual enrolments

      The testing aims to ensure that the improvement won't cause a regression in the future.

      1. Login as admin
      2. Create a new user
      3. Create a course
      4. On the course page, navigate to Participants.
      5. Click the Enrolled Users dropdown
      6. Select Enrolment Methods
      7. Click the gear/edit icon at the Manual enrolments
      8. Set the below value to the form:
        • Enable the Default enrolment duration, set to 1 days.
        • Notify before enrolment expires: Enroller and enrolled user
        • Notification threshold: 1 days
      1. Click the save changes button
      2. Navigate to course participants
      3. Click the Enrol users button
      4. Select the user
      5. Assign role to student
      6. Click the show more... link to show the other form inputs.
      7. Set the Enrolment duration dropdown to 3 days
      8. Click the Enrol users button
      9. Verify that the user exisit in the participants list as a student
      10. Change your local OS date time to the upcoming 2 days.
      11. Navigate to scheduled tasks in the site admin
      12. Search for "\enrol_manual\task\send_expiry_notifications"
      13. Click the run now link
      14. At the confirmation dialog click Run now button
      15. Verify that there is no error during the process.
      16. Open the Mailpit in the browser
      17. Verify that there are 2 new emails.
      18. The first email is for the enroller

        Enrolment in the course 'test1' will expire within the next 1 days for the following users:
            Max Lewis - Sunday, 3 March 2024, 9:08 AM
        To extend their enrolment, go to http://moodleweb.test/user/index.php?id=44
        

      19. The second email is for the student.

        Dear Max Lewis,
        This is a notification that your enrolment in the course 'test1' is due to expire on Sunday, 3 March 2024, 9:08 AM.
        If you need help, please contact Admin User.
        

      20. Change back your local OS date time to the current time.
      Show
      Setup requirement: The testing needs an email testing tool like maiplit ( https://github.com/axllent/mailpit ).  Do not forget to set SMTP Outgoing mail configuration in your site admin by specifying the SMTP hosts with your email testing tool. Mailpit uses 0.0.0.0:1025 Ensure to Specify the "Path to PHP CLI". in the Site Admin > Server > System paths Testing: 1. Log in as admin 2. Create a course 3. On the course page, navigate to Participants. 4. Click the Enrolled Users dropdown 5. Select Enrolment Methods 6. Enable The Self enrolment by clicking the eye icon 7. And then click the gear/edit icon 8. Disable the "Enrolment duration". 9. At the "Notify before enrolment expires" dropdown. Select "Teacher and Enrolled user". 10. At the "Notification threshold". Set 1 day. 11. At the "Unenrol inactive after" dropdown. Select 7 days. 12. Click the Save changes button 13. Logout 14. log in as a student 15. Navigate the course 16. Click the Enrol me button 17. Logout  18. Log in as admin 19. Navigate the course 20. Navigate to the Participants 21. Verify that the student is on the list. 22. Change your local OS date time to the upcoming 7 days. 23. Navigate to Site Admin > Server > Tasks > Scheduled tasks 24. At the "Self enrolment send expiry notifications task", click the "Run now" link. 25. You will see confirmation dialogue. Click "Run now". 26. Verify that there is no error message in the output. 27. Open the Mailpit in the browser 28. Verify there is a new email with the "Self enrolment expiry notification" subject with the body: Hi Max Lewis,   Your enrolment in the course Test 1 expires on Thursday, 7 March 2024, 3:46 AM as you have not visited it in the last 7 days. This means that you will no longer have access to the course.   To keep your enrolment active, simply log in and visit Test 1 before Thursday, 7 March 2024, 3:46 AM.  Max Lewis = Student's name Test 1 = Course name 29. Verify that the last course name is clickable and it will navigate user to the course page. 30. Change back your local OS date time to the current time. Testing Expiring manual enrolments The testing aims to ensure that the improvement won't cause a regression in the future. Login as admin Create a new user Create a course On the course page, navigate to Participants. Click the Enrolled Users dropdown Select Enrolment Methods Click the gear/edit icon at the Manual enrolments Set the below value to the form: Enable the Default enrolment duration, set to 1 days. Notify before enrolment expires: Enroller and enrolled user Notification threshold: 1 days Click the save changes button Navigate to course participants Click the Enrol users button Select the user Assign role to student Click the show more... link to show the other form inputs. Set the Enrolment duration dropdown to 3 days Click the Enrol users button Verify that the user exisit in the participants list as a student Change your local OS date time to the upcoming 2 days. Navigate to scheduled tasks in the site admin Search for "\enrol_manual\task\send_expiry_notifications" Click the run now link At the confirmation dialog click Run now button Verify that there is no error during the process. Open the Mailpit in the browser Verify that there are 2 new emails. The first email is for the enroller Enrolment in the course 'test1' will expire within the next 1 days for the following users:     Max Lewis - Sunday, 3 March 2024, 9:08 AM To extend their enrolment, go to http://moodleweb.test/user/index.php?id=44 The second email is for the student. Dear Max Lewis, This is a notification that your enrolment in the course 'test1' is due to expire on Sunday, 3 March 2024, 9:08 AM. If you need help, please contact Admin User. Change back your local OS date time to the current time.
    • 2
    • Moppies Moodle 3.8 Sprint 2, Moppies Moodle 3.8 Sprint 3, Moppies Moodle 3.8 Sprint 4, Moppies Moodle 3.8 Sprint 5, Moppies Moodle 3.8 Sprint 6, Team Hedgehog 2023 Sprint 4.2, Team Hedgehog 2023 Sprint 4.3, Team Hedgehog 2023 Review 4, Team Hedgehog 2024 Sprint 1.1, Team Hedgehog 2024 Sprint 1.2

      On moodle.org this really shows a lot. Some people apparently just monitor the forums via email, and then eventually get kicked out after 60 days.

      But we don't tell them, so they sometimes don't notice for a while.

      A little message like this would be ideal:

      "Hey, are you still there? You've not visited this course in X days, so we're going to automatically unenrol you from the course and stop sending you emails. However, we'd love to see you again - come and join in!"


      Edited to add: In self enrolment there is a setting 'Notify before enrolment expires', however this is only for when an enrolment duration is set.

      This issue is about having a notification related to the setting 'Unenrol inactive after'.

        1. (1) 21 Passed -- (Main)MDL-46886.png
          (1) 21 Passed -- (Main)MDL-46886.png
          73 kB
        2. (1) 28 Passed -- (Main)MDL-46886.png
          (1) 28 Passed -- (Main)MDL-46886.png
          65 kB
        3. (1) 30 Passed -- (Main)MDL-46886.png
          (1) 30 Passed -- (Main)MDL-46886.png
          47 kB
        4. (1) 31 Passed -- (Main)MDL-46886.png
          (1) 31 Passed -- (Main)MDL-46886.png
          88 kB
        5. MDL-46886_step21.png
          MDL-46886_step21.png
          100 kB
        6. MDL-46886_step28.png
          MDL-46886_step28.png
          70 kB
        7. MDL-46886_step28-1.png
          MDL-46886_step28-1.png
          108 kB
        8. MDL-46886_step30.png
          MDL-46886_step30.png
          40 kB

            Votes:
            4 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 weeks, 1 day, 7 hours, 18 minutes
                2w 1d 7h 18m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.