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

Welcome e-mails are sent even when 'sendcoursewelcomemessage' is set to 'no'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2 regressions, 3.2.1
    • Fix Version/s: 3.2.2
    • Component/s: Enrolments
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable self-enrolment in a course and specify "Send course welcome message" as "No"
      2. Self-enrol as another user and make sure no email was sent
      3. As teacher/admin change this enrolment method to send course welcome message
      4. As yet another user enrol yourself in a course and make sure email was sent
      Show
      Enable self-enrolment in a course and specify "Send course welcome message" as "No" Self-enrol as another user and make sure no email was sent As teacher/admin change this enrolment method to send course welcome message As yet another user enrol yourself in a course and make sure email was sent
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull Master Branch:
      wip-MDL-57782-master

      Description

      I've upgraded from Moodle 3.1 to 3.2.1 and now Moodle is sending welcome e-mails to students who self enrol on the courses, even when "Send course welcome message" is set to "no" (both on plugin config and course instance).

      I've changed the code at enrol/self/lib.php and it seens to fix the problem:

      diff --git a/enrol/self/lib.php b/enrol/self/lib.php
      index 565f3ef..db8ed4b 100644
      --- a/enrol/self/lib.php
      +++ b/enrol/self/lib.php
      @@ -173,7 +173,7 @@ class enrol_self_plugin extends enrol_plugin {
                   }
               }
               // Send welcome message.
      -        if ($instance->customint4 !== ENROL_DO_NOT_SEND_EMAIL) {
      +        if ($instance->customint4 != ENROL_DO_NOT_SEND_EMAIL) {
                   $this->email_welcome_message($instance, $USER);
               }
           }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                lksato Leandro
                Peer reviewer:
                Marina Glancy
                Integrator:
                Dan Poltawski
                Tester:
                Rajesh Taneja
                Participants:
                Component watchers:
                Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Mar/17