Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Email reminders for calendar events

From MoodleDocs

Introduction

Reminders are very useful for both students as well as teachers to recall their scheduled event before the actual moment. This project is about creating a set of reminders for Moodle calendar events and sending them automatically to relevant users on timely manner via Moodle message interface. It will be implemented as a local plugin to the Moodle.

Requirements

Moodle 2.2 required

Community Bonding Period

Milestones

  1. Refine the project proposal with Michael and the community
  2. Feature discussion
  3. Create mockups

Features

Following features are expecting to package with the reminders plugin.

1. Administrator configurations
  • Administrator can enable/disable the process of sending reminders without uninstalling the plugin.
  • Ability to choose how many days ahead should the reminders be created for every due event in Moodle calendar.
    • Reminders can be created only by days.
    • Supported only fixed amount of days ahead such as 7 days, 5 days, 3 days and 1 day.
  • Ability to keep/remove history of reminder events.
2. User configurations
  • User can select desired method of receiving reminder notifications on corresponding message provider.

Coding Period

Milestones

1. Finalize the overall architecture.
2. Finalize file structure and database table schema.
3. Designing a proper message content.
4. Building the basic structure of the plugin - Implementation Phase 1
  • Creating a suitable version file.
  • Define the database structure in XMLDB file.
  • Define capabilities.
  • Define the message provider.
  • Define a set of administrator page settings
    • Implementation of an option for enabling/disabling reminder.
    • Implementation of a set of options to configure per-defined number of days ahead which reminders should be invoked.
  • Implementation of the initial script to be run.
  • Creating a language file.
5. Building functions - Implementation Phase 2
  • Implementation of supportive functions for main cron function.
    • HTML message content.
    • Reminder Plain-text.
  • Implementation of the cron function.
    • Removing expired reminders.
    • Fetching all active reminders.
    • Fetching all users correspondent to the event.
    • Deleting reminders that have been already sent.
6. Testing
7. Bug fixing

File Structure

Plugin name would be "reminders".

  • db/access.php
  • db/message.php
  • db/install.php
  • db/install.xml
  • db/upgrade.php
  • db/events.php
  • lang/en/local_reminders.php
  • version.php
  • lib.php
  • settings.php
  • README

Database Structure

A single database will be used to store these reminders. Database name would be "local_reminders". Following shows its structure. (Subject to change)

Field Type Description
id bigint(10) Primary key for reminder records.
eventid bigint(10) Foreign key for corresponding event.
daysahead bigint(10) Number of days ahead such that reminder should be invoked.
enabled smallint(4) Indicates whether this single reminder is enabled or not. Disabled reminder will not be invoked only for that time. If it has been found enabled later, then it would be invoked.
mailed smallint(4) Indicates whether this reminder has been already mailed. Mailed reminders will be deleted after sometime.

Architecture Diagram

Mockups

Administrator Setting Page

admin settings page.jpg

Message Format (HTML)

  • Message Title : Reminder: ${event_detail} @ ${event_date_time}

message format HTML.jpg

Message Format (Plain-text)

  • Message Title : Reminder: ${event_detail} @ ${event_date_time}

File:message format plaintext.jpg

Screenshots