General plugins (Local): Upload notification

Maintained by Picture of Hendrik WürzHendrik Würz, Picture of Guido RoesslingGuido Roessling
Students can receive mails for new material and a changelog will be generated for updated documents provided in the course.
36 sites
11 fans
Current versions available: 2

Upload notification

This plugins allows students to receive a notification as soon as new material becomes uploaded. Optionally the new file can be included in the mail directly. For updated material a changelog will be displayed which includes the changed page for PDF documents.


Copyright (c) The Development Manager Ltd, Hendrik Wuerz

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <>;.



  1. Install the dependency local_changeloglib with the required command line tools (See in the changeloglib repository.)
  2. Clone the repo inside MOODLE_HOME/local/uploadnotification
    cd path/to/moodle/home
    git clone local/uploadnotification
  3. Browse to Site Administration -> Notifications and allow the database upgrades to execute
  4. After installation define your admin settings to customize the plugin behaviour. See chapter Features of this document for more information.


This plugin provides tests for the main features. To run them please follow the next steps:

  1. Install PHPUnit on your system and configure moodle. See for more information.
  2. Install the plugin.
  3. Run the tests
    cd /path/to/moodle/home
    php admin/tool/phpunit/cli/init.php
    vendor/bin/phpunit --group local_uploadnotification


Mail delivery for new material

The plugin can inform your students as soon as new material is published in one of their courses. The delivered mail can optionally include the new file. These functions must be enabled by three parties: The moodle admin, the teacher and the student. The options for courses and for students are only visible if the admin has enabled the feature.


As a moodle admin follow these steps

  1. Go to Site administration -> Plugins -> Local plugins -> Upload notification
  2. Set Allow notification mail delivery to yes. This will enable the mail delivery for course admins and students. If you set it to no, the delivery is completely disabled: No one can see the settings and no mails will be send in any case.
  3. Set Maximum filesize of mail attachments (in KB) to 100000. This will allow attachments up to 10MB. If this value is zero, no attachments will be send.

Now the feature is visible for teachers and students. As a general rule: A mail will only be send if someone (teacher or student) has requested the delivery and no one has forbidden it.


As a teacher follow these steps

  1. Go to your course -> Open the course menu (where you can access the settings, turn editing on, ...) -> Click on the link Uploadnotification
  2. You have three options for Enable notification mail delivery for material uploads
    • No preferences The default option. No mails will be send except the user requests them.
    • Disable No mails will be send for actions in this course. The student settings are ignored.
    • Enable Mails will be send except a user has disabled the delivery for himself.
  3. Set the check mark for Allow email attachments (this is the default). This will allow students to receive mails with attachments. As a teacher you can not force this to avoid unwanted traffic.


As a student follow these steps

  1. Click on your username and select Preferences
  2. At Miscellaneous you find a link Uploadnotification
  3. All students have two settings:
    • Enable notification mail delivery for material uploads with the same options as teachers. No preference will only send mails if the course settings have enabled them. Enable sends always mails except a teacher has disabled the feature for a course. Disable will never allow the mail delivery to this student.
    • Maximum filesize of mail attachments (in KB) Insert a value greater zero to receive attachments up to this size. You can not request sizes which are greater than the limit of the moodle admin. The attachment will only be send if the teacher has not removed the check mark in his his course.


Changelog generation

The plugin can build a changelog for uploaded resources. It will include the timestamp of the update and the filename of the predecessor. At the moment only file resources are supported (no folders, pages, or others). For PDF documents, the plugin can detect the page number on which changes were performed.

Teachers can update material on two ways:

  1. Delete the old resource and upload the new document independently
  2. Edit the current resource and select a new file.

A file and its predecessor must be uploaded in the same course and section.


To enable the changelog, the moodle admin has to allow this feature. If he has deactivated it, teachers will not see the options in the course settings.

  1. Go to Site administration -> Plugins -> Local plugins -> Upload notification
  2. Set Allow automatic changelog generation in courses on true. This will activate the feature for teachers.
  3. Set Allowed size of analysed files for the diff detection (in MB) to 100. This will allow the plugin to search for differences on documents with maximum 100MB filesize. If you set this value to zero, a changelog can be generated, but the pages where changes are performed will not longer be identified.
  4. Set Enable the changelog in new courses by default and Enable the diff detection in new courses by default to true. This will activate the changelog and diff detection in all courses which have no custom settings.

As a teacher follow these steps to customize the behaviour in your course:

  1. Go to your course -> Open the course menu (where you can access the settings, turn editing on, ...) -> Click on the link Uploadnotification
  2. Set Display a changelog for updates to true. This will print an information with the filename of the predecessor and the time of the change next to the new document.
  3. Set Detect differences in updates to true. This will search for changed pages in the new document and add their numbers to the changelog. This feature only works for PDF documents which are smaller than the admin-limit.
  4. Create a new PDF document in your course.
  5. Edit the new document and upload an update with a few changes.
  6. On the course page, the changelog will be displayed.
  7. Delete the updated resource and upload a version which was changed again a little bit. This upload must be in the same section as before.
  8. After a page reload (limitation of moodle because the upload was performed via ajax) the changelog is displayed again.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4


Picture of Hendrik Würz
Hendrik Würz (Lead maintainer)
Picture of Guido Roessling
Guido Roessling: Maintainer
Please login to view contributors details and/or to contact them

Comments RSS


  • Picture of mustiko aji
    Tue, Jan 22, 2019, 9:36 AM
    Hi Hendrik,

    If I add some activity in my course at 06:00 a.m, set digest delivery at 07:00 a.m and the moodle cron will executed at 07:01 a.m. What the time mail notifications can be sent? or what time will the student receive a notification email?

    Regards, Adji
  • Picture of Hendrik Würz
    Tue, Jan 22, 2019, 11:19 PM
    Hi Adji,

    the answer to your question depends on the settings of the students.

    Scenario 1: The student has not set any preferences for the digest delivery or has disabled it
    06:00 am: File created
    06:05 am: First possible delivery time
    07:00 am: No actions
    07:01 am: Mail delivery

    Scenario 2: The student explicitly requested a digest delivery
    06:00 am: File created --> Scheduled for 07:00 because of the digest request
    06:05 am: No actions
    07:00 am: No actions
    07:01 am: No action because the planning time plus five minutes (= 07:05 am) is still in the future.
    07:05 am (or any time later): Mail delivery as soon as the cron is executed

    I recommend you start the cron job every minute. In this case, the delay between uploading and sending the mail is quite low. (See also )

    Regards, Hendrik
  • Picture of Travis Reems
    Wed, Jan 23, 2019, 6:29 AM
    If changeloglib is not previously installed, installing this plugin causes error 500, which was not fun to trace and fix.
  • Picture of mustiko aji
    Wed, Jan 23, 2019, 12:04 PM
    Hi Travis,

    Have you deleted the uploadnotification plugin? install the poppler & check diff in your system (linux's server) with the terminal or putty, and then install the changloglib (changloglib required poppler & diff), Finally install the uploadnotification.

    Regards, Adji
  • Picture of mustiko aji
    Wed, Jan 23, 2019, 12:22 PM
    Hi Hendrik,

    Thank you for the answer. I had run the cron job every 2 minutes, before I installed this plugin. where can I check if the notification email is not sent? I have checked in the mail server, there is no email about that notificiation. Thanks.
    Regards, Adji
  • Picture of Hendrik Würz
    Thu, Jan 24, 2019, 2:40 AM
    Hi Adji,

    You said that you checked the mail server. Was this the source server of Moodle, or the receiving server of a student? The SMTP server of Moodle has to be set correctly, because the plugin uses the standard mail function of Moodle. You can have a look at YOUR-MOODLE-SERVER/admin/settings.php?section=outgoingmailconfig if you haven't done so or try this useful plugin to send a test mail

    In addition, the plugin only sends mails to registered _students_. As an admin, you may not get any notification. Did you check the inbox of a student of the course?

    Did you activate the notifications in the course? It can be done at Course Page -> Settings Icon -> "Upload Notification" -> "Enable notification delivery for material uploads" -> "Enable"

    If these points have not yielded any results, you can look directly in the database. The plugin creates a table called local_uploadnotification in which all planned and not already delivered mails are stored. When you upload a file, a new record will be created. When the mail is sent, the record becomes deleted. You can check whether the records exist in your system. Unfortunately, there is no dashboard for this data. So you have to look directly into the database via the command line or use an external tool like phpmyadmin.

    Best regards, Hendrik
  • Picture of mustiko aji
    Thu, Jan 24, 2019, 12:27 PM
    Hi Hendrik,

    The problem is over. I have changed the SMTP Session limit (before : 1, after : 10/ session), that's what makes email not sent.
    If create some activity -> create record in the database (automatically), after 5 minutes the data is lost.
    If the database is empty (no record in the table), the email should be sent. If not sent the problem is SMTP Session limit. I think that's the problem.

    Thanks for your help.
    Regards, Adji
  • Picture of Hendrik Würz
    Fri, Jan 25, 2019, 12:20 AM
    Hi Adji,
    I'm glad to hear that it works now.
    Regards, Hendrik
  • Picture of Anja Wehking
    Wed, Oct 16, 2019, 2:46 PM
    Hi Hendrik, hi Guido,
    does the plugin runs with moodle 3.7?

    Regards, Anja
  • Picture of Guido Roessling
    Wed, Oct 16, 2019, 2:49 PM
    Yes, it works under 3.7. Thank you for asking - I just updated the plugin description to show 3.7 support.
  • Picture of Anja Wehking
    Wed, Mar 4, 2020, 7:47 PM
    since we've updated to moodle 3.8 the plugin doesn't work properly. There's a course where messages are sent and another where no messages are sent, but both courses have the same settings. Is this due to the incompatibility or might there be another reason? Thanks for suggestions.

    Regards, Anja
  • Picture of Kilah Honoe
    Fri, Apr 24, 2020, 8:37 PM
    Hi, my moodle site got totally "white paged" after trying to install the plugin, using moodle 3.8. What do I have to do to undo this?
  • Picture of Guido Roessling
    Fri, Apr 24, 2020, 10:08 PM
    I would be surprised if this plugin is indeed to blame for that, as we have it running, as well. If simply uninstall the plugin, your site should be back in working order.
  • Picture of Felix G.
    Wed, May 6, 2020, 2:37 AM
    Hey Guido,
    I have the same problem. "White Page" after installing your plugin.
  • Picture of Guido Roessling
    Wed, May 6, 2020, 1:24 PM
    Hi Felix,
    I am sorry to hear that, but cannot confirm these issues here. Can you please do the following steps and let me know what comes out of it?
    1. Uninstall the plugin (e.g., manually delete ......./local/uploadnotification and ....../local/changeloglib)
    2. Check that Moodle now works flawlessly (no "white page")
    3. Turn on debugging
    4. Reinstall the plugin
    5. Check if the "white page" has reappeared
    6. Look at the server logs (near the end) of your web server and copy the error message. That should give a clue to what is wrong.
    (then de-install the plugin and reset debugging to the previous level).
    Thank you!
Please login to post comments