General plugins (Local): Event Reminders

local_reminders
Maintained by Picture of Isuru Madushanka WeerarathnaIsuru Madushanka Weerarathna
Automate sending reminders for calendar events.
1121 sites
305 downloads
71 fans
Current versions available: 10

This plugin will automatically send reminders for Moodle calendar events in a timely manner via Moodle message interface. This plugin allows users to control how they receive messages for each event types in Moodle calendar.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Picture of Isuru Madushanka Weerarathna
Isuru Madushanka Weerarathna (Lead maintainer)
Picture of Rossiani Wijaya
Rossiani Wijaya: Mentor
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Picture of Isuru Madushanka Weerarathna
    Mon, Apr 3, 2017, 12:33 PM
    @Mr. Marc
    Event reminders will work if you can create a calendar event (manually or automatically) for each interested type of offering.
  • Picture of Tim Quenan
    Thu, Apr 6, 2017, 4:46 AM
    Seeing two issues within the cron scripts when trying to send out reminders. I'm running Moodle version 3.2.2 against an Oracle 11 DB.

    The first is for a Course or Close Events:

    [Local Reminder - ERROR] Error occured when initializing for event#[581] (type: course) Error reading from database
    [Local Reminder - ERROR] #0 /u01/apolloglobal/moodle/ies/noah/lib/dml/oci_native_moodle_database.php(277): moodle_database->query_end(false)
    #1 /u01/apolloglobal/moodle/ies/noah/lib/dml/oci_native_moodle_database.php(1179): oci_native_moodle_database->query_end(false, Resource id #2429)
    #2 /u01/apolloglobal/moodle/ies/noah/lib/accesslib.php(3937): oci_native_moodle_database->get_records_sql('SELECT DISTINCT...', Array, '', '')
    #3 /u01/apolloglobal/moodle/ies/noah/local/reminders/lib.php(280): get_role_users(Array, Object(context_course), true, 'ra.id as ra_id,...')
    #4 /u01/apolloglobal/moodle/ies/noah/lib/cronlib.php(223): local_reminders_cron()

    The second is for Site events:
    [Local Reminder - ERROR] Error occured when initializing for event#[602] (type: site) Error reading from database
    [Local Reminder - ERROR] #0 /u01/apolloglobal/moodle/ies/noah/lib/dml/oci_native_moodle_database.php(277): moodle_database->query_end(false)
    #1 /u01/apolloglobal/moodle/ies/noah/lib/dml/oci_native_moodle_database.php(1179): oci_native_moodle_database->query_end(false, Resource id #1786)
    #2 /u01/apolloglobal/moodle/ies/noah/local/reminders/lib.php(254): oci_native_moodle_database->get_records_sql('SELECT * \r\n ...')
    #3 /u01/apolloglobal/moodle/ies/noah/lib/cronlib.php(223): local_reminders_cron()
    #4 /u01/apolloglobal/moodle/ies/noah/lib/classes/task/legacy_plugin_cron_task.php(163): cron_execute_plugin_type('local', 'local plugins')

    I'm trying to get more details regarding the DB errors that are thrown, but was hoping folks here may have some insight into the issue.
  • Picture of Mark B
    Mon, Apr 24, 2017, 10:10 PM
    I have solved the problem with reminders not working in moodle 3.1.5 if anybody is interested to know.

    Basically i did the following

    1. i noticed that version 1.3.1 will work but it sent reminders out more than once due to a bug. After an upgrade to versions 1.4, 1.4.1 and 1.5 i noticed that event reminders didn't send

    2. I downloaded 1.4 to find out how the repeated reminders were no longer sent and i noticed that a database table was not created for this plugin

    3. I went into the lib.php file and modified the following lines of text to be as follows:

    The logrows line to now become:
    $logrows = $DB->get_records("local_reminders", array(), 'time DESC', '*', 0, 1);

    timewindowstart variable line:
    $timewindowstart = $firstrecord->time + 1;

    Changed the following if function in local_reminders_cron to the following:
    if ($upcomingevents == false) { // no upcoming events, so let's stop.
    mtrace(" [Local Reminder] No upcming events. Aborting...");
    add_to_log(0, 'local_reminders', 'cron', '', $timewindowend, 0, 0);
    add_flag_record_db($timewindowend, 'no_events');
    return;
    }

    Added the following to the bottom of local_cron_reminders (before the add_to_log line)
    add_flag_record_db($timewindowend, 'sent');


    Added into lib.php:
    function add_flag_record_db($timewindowend, $crontype = '') {
    global $DB;

    $newRecord = new stdClass();
    $newRecord->time = $timewindowend;
    $newRecord->type = $crontype;
    $DB->insert_record("local_reminders", $newRecord);
    }

    Please note that add_to_log doesn't appear to work in moodle 3.0+ from what i have noticed and so that is obsolete

    Finally go into your phpmyadmin or whatever database software you use and set up the following:
    table name: yourmoodleprefix_local_reminders (in my case it is modl_local_reminders)

    column name: id; type: bigint(10); auto increment
    column name: time; type: varchar(16); null: no
    column name: type; type: varchar(32); null: yes; default: null

    If you don't want to do the last part i simply copied the structure of the database from version 1.4 onwards. If anybody would like a copy of my lib.php then i can send this over but as i say, the database table is just the same as version 1.4 onwards
  • Picture of Andrew Grossmann
    Fri, Jul 7, 2017, 1:45 AM
    I am receiving the following error when trying to send reminders for Group Events:
    [Local Reminder - ERROR] Error occured when initializing for event#[101] (type: group) Coding error detected, it must be fixed by a programmer: Invalid modulename parameter
    [Local Reminder - ERROR] #0 /data/www_root/html/xxx/local/reminders/contents/group_reminder.class.php(60): get_coursemodule_from_instance('0', '0', '4')

    Any ideas about how to remedy this? Thanks.
  • Picture of Isuru Madushanka Weerarathna
    Fri, Jul 7, 2017, 4:57 PM
    Hi Andrew,
    Which moodle version and plugin version you use? I believe it is somewhat older and we fixed it in the latest version.
    (See this diff: https://github.com/isuru89/moodle-reminders-for-calendar-events/commit/9116a412a9c1e2cd9a8d8fc34fd4c75f381563d1#diff-91d5700bd6a6490b6f68e88225034bde)

    Check whether the below shown condition is there with your plugin code. If not, you can add the line and verify it again.
    https://github.com/isuru89/moodle-reminders-for-calendar-events/blob/master/contents/group_reminder.class.php#L58


  • Picture of Andrew Grossmann
    Wed, Jul 12, 2017, 3:41 AM
    Thank you, Isuru. The updated version solved the issue.
  • Picture of Margaret Richards
    Tue, Aug 8, 2017, 6:27 AM
    Are there plans to make a version compatible with Moodle 3.1?
  • Picture of Marc McLain
    Sat, Aug 19, 2017, 4:38 AM
    I'm using this currently in Moodle 2.7. Is there a way to segment the reminders notifications by course?
    Example: I own course A and course B, but as a user I only want to receive reminders from Course B. Is that possible? Is there a way to adjust the Plugin Code to make this possible?
  • Picture of AC Cheng
    Mon, Aug 21, 2017, 10:21 PM
    Is the Custom Schedule not working? The 1, 3, 7 days reminders work for me. I'm not getting email reminders for the custom schedule e.g. 1 hour before activity starts. Is it a either/or function? Not both works. Like you can only use 1,3,7 days or custom schedule? Thanks.

    Custom schedule:
    local_reminders_duecustom
    Additionally specify desired schedule to send reminders in ahead of time for an event.
  • Picture of Isuru Madushanka Weerarathna
    Sat, Aug 26, 2017, 1:22 PM
    @Margaret Richards
    The latest plugin v1.5 should work in Moodle 3.1.
  • Picture of Isuru Madushanka Weerarathna
    Sat, Aug 26, 2017, 1:32 PM
    @Marc McLain
    I thought this could be done using profile specific settings as shown in here. https://docs.moodle.org/27/en/Messaging_settings#User_profile_settings

    However, currently the plugin does not support a profile/activity specific configurations to tweak out which messages should he/she receive, which I need to consider technical aspects of it in terms of how to do it.
  • Picture of Isuru Madushanka Weerarathna
    Sat, Aug 26, 2017, 1:38 PM
    @Intist Sro
    Currently the reminders work only for 1,3,7 days ahead, and there is no way to have a custom schedule from configuration unless you can modify the the code. Those days were carefully selected at the beginning of plugin development considering a reasonable reminder schedule for everyone.

    In short, you have to add a desired schedule in line 47 and append that constant in to line 124 in lib.php file to check for a custom schedule.
    And also you may want to edit settings.php file to appear custom schedules on configuration page.

    I will consider this as a feature for a future release.
    Thanks.
  • Picture of Alan Brown
    Wed, Sep 20, 2017, 6:35 AM
    Will this also work on 3.3?
  • Picture of Peter Ward
    Wed, Sep 20, 2017, 1:41 PM
    I have reminders working just fine in v3.3.1
  • Picture of Isuru Madushanka Weerarathna
    Wed, Sep 20, 2017, 4:08 PM
    @Alan Brown
    This should work with v3.3 as far as I know there is no significant api changes which affects the operation of plugin.
    You may use plugin latest version.
Please login to post comments