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

Forum does not observe message notification settings for digest emails

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Automated tests
      1. Run unit tests
      Manual tests
      Pre-requisites
      1. Correctly configured MTA OR something like http://mailcatcher.me/
      Testing
      1. Create a course and enrol a user
      2. Set that user's forum mail preference to full digest
      3. Create a new forum in the course, and subscribe the user to the whole forum
      4. Make a number of posts in the forum
      5. Make the following change to mod/forum/lib.php:

        diff --git a/mod/forum/lib.php b/mod/forum/lib.php
        index 29f4f6d..5c83469 100644
        --- a/mod/forum/lib.php
        +++ b/mod/forum/lib.php
        @@ -902,6 +902,8 @@ function forum_cron() {
             $weekago = $timenow - (7 * 24 * 3600);
             $DB->delete_records_select('forum_queue', "timemodified < ?", array($weekago));
             mtrace ('Cleaned old digest records');
        +    $digesttime = $timenow - 1;
        +    $CFG->digestmailtimelast = $weekago - 1;
         
             if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) {
        

      6. Run the forum scheduled task:

        php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task"
        

      7. Check your e-mail
        1. Confirm that you received the forum message
      Show
      Automated tests Run unit tests Manual tests Pre-requisites Correctly configured MTA OR something like http://mailcatcher.me/ Testing Create a course and enrol a user Set that user's forum mail preference to full digest Create a new forum in the course, and subscribe the user to the whole forum Make a number of posts in the forum Make the following change to mod/forum/lib.php: diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 29f4f6d..5c83469 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -902,6 +902,8 @@ function forum_cron() { $weekago = $timenow - (7 * 24 * 3600); $DB->delete_records_select('forum_queue', "timemodified < ?", array($weekago)); mtrace ('Cleaned old digest records'); + $digesttime = $timenow - 1; + $CFG->digestmailtimelast = $weekago - 1;   if ($CFG->digestmailtimelast < $digesttime and $timenow > $digesttime) { Run the forum scheduled task: php admin/tool/task/cli/schedule_task.php --execute="\mod_forum\task\cron_task" Check your e-mail Confirm that you received the forum message
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_27_STABLE, MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-44087-master
    • Sprint:
      3.1 Sprint 4
    • Issue size:
      Small

      Description

      The Forum digest settings do not observe any notification settings.

      The only switch for receving forum emails is the in the user profile "Email digest type", which can only be set to:

      • Subjects
      • Complete
      • Digest

      This means that it is not possible for a user to not receive any emails (in our case we have audit users, who can access classes that contain forced subscription forums).

      The "emailstop" attribute in the past could have been used to this but as indicated in MDL-26304 & MDL-27171 this has been deprecated in favour of the "Private Messaging" settings for a user.

      However if you set "Temporarily disable notifcations" forum digest emails are still sent.

      I think that there is still a case for should be "administrative" mechanism to disable all emails for a user account (without having to resort to blackhole email address etc), whether this is a re-instatement of the "emailstop" option or adding a "No email" option to the "Email Digest Type" setting.

      Note

      The fix for this issue means that messages now come from "Do not reply to this email", whereas they used to come from $site->shortname.
      The message subject remains as "$site->shortname: forum digest"

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  23/May/16