I wish to propose an "Calendar Event Reminder"

I wish to propose an "Calendar Event Reminder"

by Román Huerta -
Number of replies: 34
Hi, I had an requirement for my moodle, and it was that the systems send an email to the user alerting him that he has something to do, this could be set by the user when he set an event.

Maybe this functionality could be extended to send mails when a teacher set the grades for his students, so that the system alerts them.

Sorry if my specification is not to formal. but is also my first post. I wait your replies.

Thanks
Average of ratings: -
In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by arturo ruvalcaba -
Hi Roman,

I know how you feel. I am proposing Moodle to a mid-sized company to replace their current LMS, and they are set on rejecting it due to the lack of automatic email reminders / notifications.

I'm trying to find ways around it, but it seems like Moodle doesn't feel like this is a critical requirement.

Does anyone know if this capability exists? for example, i set up an event, and X days before the event, a reminder is sent out.

I personally LOVE Moodle and see nothing wrong with it, (as a moodle administrator), but when the organization wants to have it set up and run automatically, then this is a HUGE issue.

Maybe someone can shed some light on this?

Thanks
Arturo
In reply to arturo ruvalcaba

Re: I wish to propose an "Calendar Event Reminder"

by Brian Schmidt -
I have not tried it, but you may want to check out this add-on, depending on your version of Moodle:
http://moodle.org/mod/data/view.php?d=13&rid=755
In reply to Brian Schmidt

Re: I wish to propose an "Calendar Event Reminder"

by arturo ruvalcaba -
Thanks Brian,

Someone pointed me to that module. It doesnt seem to be up for 1.9 and it has errors on 1.8! I'll keep an eye on it though

Thanks!
Arturo
In reply to arturo ruvalcaba

Re: I wish to propose an "Calendar Event Reminder"

by Tara M -
I too would love a reminder system that's built right into Moodle.
In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by Román Huerta -
I've made an script that I run in a cron, it is suppoused to be working ok, but I'm no using any moodle function at all, so if you like to check it out send me your e-mail and I'll send you it.

By the way, I used spanish works to code it, I'll try to traduced it when I have time
In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by Marc Grober -
I would very much like to look at it after you have translated it.
In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by Román Huerta -
Here I upload the script I made, this works on moodle 1.9, if you wish the user to enable/disable the event remider you'll need to add some fields on the user table, and add a field on the user configuration, all is explained on the file I uploaded.

Good luck, and if you change the script try to upload it so everyone can use it

Bye
In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by T P -
Could you give step by step instructions on how to install this. I am very new at this.

Thanks
In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by chris nelson -
Hi

How do I use this. I can make my way around the c-panel but I'm new add this stuff. Where do I save the php to and what do I do with the second doc (change eventws reminder)?

Thanks

Chris
In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by Gautam Saha -

Hi Roman,

can you please explain which directory to install this eventreminder file?

thanks so much

In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by José Ángel Polo -

Version 1.9.3 problems
- I uploaded eventReminder.php after filling my data connection to /admin.
- I created a new field "eventReminder" likes screenreader field in the user table.
- I added the language strings.
- I modified the file user/editlib.php adding the lines indicated.
- Running /admin/eventReminder.php I get a blank page.
Can you help me, please?
Regards.

In reply to José Ángel Polo

Re: I wish to propose an "Calendar Event Reminder"

by José Ángel Polo -

Finally I´ve got the event reminder for 1.9.x version but it only sends to user events and global events, but not for course or group events.
Can you help me with this?
Thanks and best regards.

In reply to José Ángel Polo

Re: I wish to propose an "Calendar Event Reminder"

by José Ángel Polo -

Am I wrong to get the students from a course?

Please help.

/**
 Here I get the students from a course
*/
function getCourseStudents($course){
    global $DB;
    //if it is the main course
    if ($course==1){
      $rs = $DB->Execute("SELECT id,firstname,lastname,email FROM mdl_user eventreminder=1");
    }
    //other course
    else {
      $rs = $DB->Execute("SELECT u.id,u.firstname,u.lastname,u.email FROM mdl_role_assignments r, mdl_user u, mdl_context c WHERE r.contextid = c.id AND r.userid=u.id AND contextlevel = 50 AND instanceid=? AND u.eventreminder=1 ",array($course));
    }
    return $rs;
}

In reply to José Ángel Polo

Re: I wish to propose an "Calendar Event Reminder"

by Tim H -

Hello, I'm getting the same blank page.  I added the field "eventreminder" to the mdl_usr table, then uploaded eventreminder.php to the admin folder of my Moodle install.

Any ideas what is happening? 

Moodle 1.9.17+ (Build: 20120419)

In reply to Román Huerta

Re: I wish to propose an "Calendar Event Reminder"

by Martin Contreras -

Hi Roman,

I´m making a Calendar Event reminder by week.  It means you will receive a mail with all events in the week. Maybe tomorrow, I will share you with all of you. In this moment this reminder is for courseevents not for userevents neither for siteevents.

 

See you 

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

I have posted desperately in three  modules for this solution.

one is as follows...

http://moodle.org/mod/forum/discuss.php?d=186205

so my question is will i be able to use this in moodle 2.1.1 ?

or anybody knows  a solution for this???

In reply to lentin varghese

Re: I wish to propose an "Calendar Event Reminder"

by Martin Contreras -

Hi Lentin, 

I´ve made some changes for moodle 2.1

I have created two reminders one for each activity and the other one is a resume for the activities for the week

 

Read the README.txt file

Best Regards

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

Hey Martin,

 Thanx a ton...i am going to try it now......

once againg thanks a lot....

Regards,

Lentin 

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

Hi  Martin,

 May be my this question will be so dump and boring, but i dont have an option and i think it will be better if i ask you once again as i am just dumb in programming part.

1) I have to put both the attached files (eventreminder.php and weekeventsreminder.php) in the following path "/var/www/moodle/"

ami rite???

2) The function which i need to add in "moodlelib.php", can i just copy and paste in end of moodlelib.php (with adding email and from name)

3)last but most important :-

in the below path "/etc/cron.d" i have seen crontab for moodle.

with following content"

# Regular cron jobs for the moodle package
*/5 * * * * www-data [ -f /usr/share/moodle/admin/cron.php ] && /usr/bin/php -f /usr/share/moodle/admin/cron.php > /dev/null"

what should i add here to execute the script automatically every 5 hour for the above function?

your help will be very much appreciated.......and sorry for my dumb questions....

thanks,

Lentin Varghese 

In reply to lentin varghese

Re: I wish to propose an "Calendar Event Reminder"

by Martin Contreras -

Hi Lentin,

I did this in the server 

*/10 * * * * root wget 'http://**.****.**.**/moodle/course/reminderalertaccess.php' >/dev/null;

This is for execute this script each 10 minutes

in your case if you want to execute each 5 hours

* * /5 * * * root wget 'http://**.***.**.***/moodle/weekeventseminder.php' >/dev/null;

you can check this link 

http://docs.moodle.org/20/en/Cron

 

But if you don´t hace access to moodle server you can tell your moodle site administator to put this line in the server

Regards

Tell me if works or you 

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

Hi Martin,

I am not sure whether i am doing it in the proper manner.

Here is what i did:-

1) i have put "eventreminder.php and weekeventsreminder.php" in      "/var/www/moodle" .

2) I have added the function in moodlelib.php

3) I tried to create cron jobs via terminal as well as file manager. It did not work. Finally in webmin i went to scheduled cron jobs and created new cron job to run these scripts "eventreminder.php and weekeventsreminder.php" . I ran the cron job from there itself and got an output as follows 

"

Output from command wget 'http://xxxxxxxxxxxxx/weekeventsreminder.php' >/dev/null ..

--2011-10-08 14:52:05-- http://xxxxxxxxxxxxx/weekeventsreminder.php
Resolving xxxxxxxxxxxxxxx... 192.168.1.32
Connecting to xxxxxxxxxxxxx|192.168.1.32|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: `weekeventsreminder.php.1'

0K 0.00 =0s

2011-10-08 14:52:05 (0.00 B/s) - `weekeventsreminder.php.1' saved [0/0]
 
I made both of these scripts executable and tried. Then also it did not work. 
 
I followed this link to create cron jobs using webmin...
"http://doxfer.webmin.com/Webmin/ScheduledCommands"
 
Could you please let me know what i am doing wrong???
Regards & Thanks,
Lentin 
In reply to lentin varghese

Re: I wish to propose an "Calendar Event Reminder"

by Martin Contreras -

Hi Lentin,

Steps 1 and 2 ok

You are using webmin you have to do this in command box in the form

/usr/bin/wget -q -O /dev/null http://yourroot/moodle/weekeventsreminder.php

and put the schedule you want to execute the script

this is for each script

for weekeventsreminder I put every monday at 0:00

and the other one is each day at 0:01

You need to change the code in each file change the function getevents() because I get the events according the execution of the script

Regards

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

Hi Martin,

 I believe all configurations.....cron job schedules are correct ...but i think there is some thing wrong with the mail configuration. In moodle under plugins , there is a email plugin where i have configured my external smtp server details with user name and password. Will these php scripts use that settings or do i have to configure another mail transfer agent like postfix in server?

Thanks,

Lentin 

In reply to lentin varghese

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -
Web server software ({$a}) is not supported, sorry.
In reply to lentin varghese

Re: I wish to propose an "Calendar Event Reminder"

by Martin Contreras -

Hi Lentin,

mmm I don´t know how to test that

First, try to run the script manually

Type in the web explorer the route of the script. For example: http://yourmoodlesite/moodle/eventreminder.php

If it doesn´t work, is problem of your smtp server. But, if you receive mails maybe is problem in the configuration of your cron in the server.

How do you configurate the smtp server, I can ask to the admin server

Regards,

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

Hi Martin,

The webserver software unsupported error was an error came when i executed the script in webmin.

when i am executing the script in browser as you said , i am getting a blank screen. 

I got a php script which will send emails upon execution and it is working and sending out mails. 

When I am executing the script as follows in terminal

"/usr/bin/php5 /var/www/moodle/weekeventsreminder.php " i am getting an error message as follows

"Command line scripts must define CLI_SCRIPT before requiring config.php"
 
 So any clues on the above error??
 
Regards,
Lentin
In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

Hi Martin,

i have configured moodle email in the following path:-

plugins-message outputs-email 

with my mail server details and my mail server will work only with ssl

So i have enetered mail server name as "ssl://mail.XXXXXXXXXX.com:465"

in smtp hosts tab and then username and passwords.

Regards,

Lentin Varghese

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -

Hi Martin,

 

Just an update...

When i am executing the script from terminal like this "


" /usr/bin/php5 /var/www/moodle/weekeventsreminder.php"
 
I am getting an error like as follows 
"
Command line scripts must define CLI_SCRIPT before requiring config.php"
 
Any clues on this error??
Do i have to set any value CLI_SCRIPT anywhere??
 
Regards,
Lentin
In reply to lentin varghese

Re: I wish to propose an "Calendar Event Reminder"

by Patrick Pollet -

yes your command line script must start by :

define('CLI_SCRIPT', true); 

see for example yourmoodle/auth/cas/cli/sync_users.php 

define('CLI_SCRIPT', true);
require(dirname(dirname(dirname(dirname(__FILE__)))).'/config.php');
require_once($CFG->dirroot.'/course/lib.php');
// Ensure errors are well explained
$CFG->debug = DEBUG_NORMAL;
...

Cheers

In reply to lentin varghese

Re: I wish to propose an "Calendar Event Reminder"

by Martin Contreras -

Hi Lentin,

I hope you have been resolved your problem with the smtp server.It´s strange you have this problem. In my moodle I didn´t have this problem

Regards

In reply to Martin Contreras

Re: I wish to propose an "Calendar Event Reminder"

by lentin varghese -
Ohh god..is it a coincidence ???????????? Today morning both the scripts worked....... I put a cron job as given below....... "wget –output-document=temp http://academy.XXXXXX.com/weekeventsreminder.php" "wget –output-document=temp http://academy.XXXXXX.com/eventreminder.php" First one runs once in a week and second once in a day. Both works like a charm. Ohh scripting is awesome...... ;) I have used my mail server credentials instead of local smtp server. Thanks a lot for your great support Martin ...... Thanks Patrick....actually that error did not come up when i executed cron as above.... If anybody faces any issue as i have faced..please post ...i will help as i can ...but not as much as martin...... smile Once again thanks martin.... Regards, Lentin