Send notification emails function is not working in Moodle 1.9.5+.

Send notification emails function is not working in Moodle 1.9.5+.

by Shin Okada -
Number of replies: 29
I posted in Assignment forum, but I was suggested to post here.

I had migrated from 1.8+ to 1.9.5+.

It sends a notification when a new user registers, account confirmation and Welcome email after enrolment to a course.
It also send email messaging as well.

However after adding grade and comments in Assignments and ticking "Send notification emails" does not send email to students.

What can I do to fix this problem?
Can anyone suggest any fix please?

Thanks in advance.
Average of ratings: -
In reply to Shin Okada

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Mary Legg -

1.9.4+

This is not a solution (sadly).  More of a cry for help or addition to Shin's question.

After adding a grade, we want the students not to be notified yet, so should expect to have 'send notification emails' not ticked.  However we find that even though the box is not appearing ticked to the marker who is non-editing teacher, notification was still sent.

Also, for a particular student in a course, one teacher opens the assignment submissions feedback for that student and sees the box as ticked, but another Teacher opens it and it is not seen to be ticked.

In reply to Shin Okada

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Shin Okada -
It still does not work.

Is there anyone who can direct me to a right path to fix this problem??
In reply to Shin Okada

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jeff Snyder -

I guess 1.9.6 only works half way.  We can get the Student's confirmation email, but the Teacher's / Admin's notification email doesn't go through.

I also guess there's no help available...?

In reply to Jeff Snyder

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Lindley Bailey -
2 things to look at:
1. I would suspect that the students email server is accepting your emails, but the teachers email server is rejecting them?
Look in the teachers profiles to see if their email addresses are any different than the students.
2. If you added all of the teachers in the same csv file, did you accidentally make a mistake? (I mispelled our own web address, @contracters.com vice @contractors.com)
May it be something this simple,
Lin Bailey

PS I just read a post that might help:
http://moodle.org/mod/forum/discuss.php?d=99345#p644569
In reply to Lindley Bailey

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jeff Snyder -

Thanks for the help!

I took your advice and double-checked the email addresses.  I tried both roles with the same email address, and still only got the student's notification, not the teacher's.

It's not a mail problem or an SMTP issue.  All of the other mail that is supposed to be sent out gets there.

In reply to Jeff Snyder

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Colin Fraser -
Picture of Documentation writers Picture of Testers
mmm there seems to be a number of people experiencing the same issue. So at this point I would be putting a question on Moodle Tracker and upgrading every page that has the word "mail" in it. Such a widespread problem would indicate a bug perhaps?
In reply to Colin Fraser

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jeff Snyder -
I agree, unfortunately I don't know my way around Moodle Tracker (and I don't think I have login creds.) So I'm hoping someone can do the leg-work or advise me how!

--Jeff Snyder
In reply to Jeff Snyder

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Colin Fraser -
Picture of Documentation writers Picture of Testers
Jeff, for Moodle Tracker, log in, you may have to create a new account, Docs, Forums and Tracker all use different systems, obviously. There you will get the options to do what you need to do. You have to do it some time, so now would seem a good opportunity. Cheers..
In reply to Shin Okada

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Rob Butner -

We are using Moodle 1.9.4

Our system properly sends an email notification when a new user registers

Our system properly sends an email notification for account confirmation.

Our system properly sends an email notification when the student enrolls into the course.

Our system properly sends emails through the messaging system.

THEREFORE THERE ARE NO PROBLEMS WITH OUR SMTP SETTINGS OR EMAIL SERVER.

However ANY instructor grades a students ONLINE ASSIGNMENT and also adds feedback comments in Assignments Grading and ticks "Send notification emails" NO EMAILS ARE SENT TO THE STUDENTS.

We have checked the email servers SMTP logs and there are NO EMAILS being sent by the Moodle system regarding these Grade Notifications.

CHRON IS INSTALLED AND WORKING GREAT (WE DO AUTOMATED COURSE BACKUPS AND THEY RUN FLAWLESSLY)


What can I do to fix this problem?
Can anyone suggest any fix please?

Thanks in advance.

In reply to Rob Butner

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Andreas Panagiotopoulos -

Do we have any question for this issue??

I have the same problem too...

 

Thanks in advance.

Andreas P.

In reply to Andreas Panagiotopoulos

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Andreas Panagiotopoulos -

I mean, is there any reply for this bug?

I don't see that it has been solved yet...

Thanks in advance!

Andreas

In reply to Shin Okada

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Hello,

I see that this post from 2009-10 hasn't been resolved, but I'm wondering if there is anyone out there that's aware of any further troubleshooting steps that can be taken to address the issue. I'm still running Moodle 1.9.7+ and have recently had many reports of the "send notification emails" function not working when teachers attempt to notify students to let them know a comment has been made on one of their assignment submissions. Here is a link to the output from a cron job I ran yesterday, in case that provides any clues: http://mysticalmindtraining.org/cron.txt

Any help would be much appreciated!

Thanks,
Jason Press

In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jason,
your cron output is cutted in the middle of the execution which means an error that could be a timeout, an out of memory, a Moodle bug, .... To identifiy the error please activate the Moodle debugging at DEVELOPER level and look at the next cron run output.

If you can't activate that level of debug you could give the PHP error log a look.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Thanks for the clear suggestions Matteo,

I activated debugging, but wasn't sure exactly how to force cron to run again. The site I'm looking at is called mysticalmindtraining.org and so I went to http://mysticalmindtraining.org/admin/cron.php. The output is attached.

Some other info that may be relevant is that we moved the database and site to a new server a few months ago. I'm guessing this may have been when the issue started occurring, even though I'm just starting to hear reports of issues. I believe there was a scheduled cron task configured on our old server through Plesk and, when I found out about this issue (a couple days ago) I attempted to duplicate the task on our new server. Here is the command I used (also see lower half of attached screenshot):

wget -q -O /dev/null http://www.mysticalmindtraining.org/admin/cron.php

After some research today, I found this site and have tried updating the command to the following (also see upper half of attached screenshot):

/opt/php54/bin/php -q -O /dev/null http://www.mysticalmindtraining.org/admin/cron.php

Please feel free to let me know if I can provide any other info to help locate the issue.

Thanks so much,
Jason

Attachment screenshot.jpg
In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jason,
OK, your log now clearly shows that the cron could happily run unless an issue with your server PHP settings which requires you to configure the date.timezone parameter e.g. for me the setting is date.timezone = 'Europe/Rome'.
FYI, using PHP 5.4.x with Moodle 1.9 prior than 1.9.13 - to be sure use the last available 1.9.19+ - could lead to "strange" issues in some modules.

BTW, since you've changed the server have you already checked if the (old) SMTP settings are still compatible with the new server e.g. the SMTP hostname? Does the new PHP configuration allow sending emails?

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Thanks again Matteo,

I'm not quite sure where to configure the date.timezone parameter. I see that the cron output contains many instances saying that I'm "*required*" to use this setting, but it also says: "We selected 'America/Denver' for 'MST/-7.0/no DST'". Each instance sites a different line from the moodlelib.php file. Is there one place I need to go to configure this parameter or would I need to edit the moodlelib.php file line by line? I looked through Plesk and have attached a screenshot from the "System Date and Time" area. Once this is corrected, I'll be interested to see if the issue is resolved.

I'm not sure exactly how to check if the old SMTP settings are still compatible with the new server (I'm happy to check if someone could point me in the right direction), but I can say that e-mails seem to be getting through just fine in general (e.g. bulk e-mails to users through Moodle work fine and also, when students submit their assignments, the teachers are consistently receiving the e-mail notifications). Basically all settings in the admin/settings.php?section=mail area are set to default settings.

The PHP version looks like it's at version 5.3.3.

Thanks for all your help,
Jason

Attachment System Date and Time.png
In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jason,
I guess you've two different PHP versions installed on your server, one available for CLI commands and one available (e.g. via FastCGI) for web scripts: /opt/php54/bin/php IMHO means that a version of PHP 5.4 has been installed together (/opt) to another version, probably your PHP 5.3.3. Then there will be two separate php.ini: you could check it with your hosting provider.

OK, so emails are running fine except for some of them (assigment comment submission) i.e. Moodle SMTP settings are OK. I'm running out of ideas: I keep on thinking about the php.ini timezone missing configuration.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Ok, well I was able to access the php.ini file (in the "etc" directory) and added "America/Denver" to the end of what I believe is the correct location to set the timezone parameter. There was previously nothing after the "=" sign. Here's what shows up now:

; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
;date.timezone = America/Denver

In the Moodle "admin/phpinfo.php" area however ,the "date.timezone" directive still shows up as "no value" (see attached screenshot).

Is there another location that you're aware of where I can update this setting?

Some other notes:
Typing "php -v" (at the recommendation of my hosting provider) via CLI comes back with "PHP 5.3.3", which matches what I see in the "admin/phpinfo.php" area in Moodle. I didn't see "php54" on my server in the "opt" directory.

I turned "debugging" on again for a moment and this is what shows up on the "Notifications" page:
"Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MST/-7.0/no DST' instead in /var/www/vhosts/mysticalmindtraining.org/httpdocs/lib/moodlelib.php on line 1255 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MST/-7.0/no DST' instead in /var/www/vhosts/mysticalmindtraining.org/httpdocs/lib/moodlelib.php on line 1256"

Attachment Moodle phpinfo.png
In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jason,
; is used to comment out the line. Please re-arrange your php.ini to read:

...
;date.timezone =
date.timezone = 'America/Denver'

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Hi Matteo,

Thanks for that. I made the update so that the php.ini shows up as seen below and restarted the Apache Web Service, but still no change in "assignment comment submission" performance. Interestingly, the "admin/phpinfo.php" area stills shows the "date.timezone" directive as "no value".

[Date]
; Defines the default timezone used by the date functions
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
;date.timezone =
date.timezone = 'America/Denver'

Would running the "admin/timezoneimport.php" be helpful? I would want to be sure that all of the current users timezone settings wouldn't be affected...

I've attached a screenshot of my "Location settings" area, in case that is relevant.

Thanks,
Jason

Attachment Location settings.png
In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jason,
that's strange: you need to check what is the php.ini used by your web server. Please go to Site administration > Server > PHP info and search for Loaded Configuration File: there you'll find the info about the right location of the php.ini to be configured.

Site administration > Location > Update timezones is used by Moodle do better identify the timezone of a single user providing her/him dates according to her/his location i.e. it cannot fix any issue with the PHP configuration but with the representation of dates in Moodle.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Hi Matteo,

Ok, good idea. The php.ini that I've been updating is the one at /etc/php.ini. Here's what shows up around the Loaded Configuration File line in the PHP info area:

Configuration File (php.ini) Path     /etc
Loaded Configuration File     /var/www/vhosts/mysticalmindtraining.org/etc/php.ini
Scan this dir for additional .ini files     /etc/php.d
Additional .ini files parsed     /etc/php.d/00-ioncube-loader.ini, /etc/php.d/bcmath.ini, /etc/php.d/curl.ini, /etc/php.d/dba.ini, /etc/php.d/dom.ini, /etc/php.d/fileinfo.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/json.ini, /etc/php.d/ldap.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/odbc.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_odbc.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/snmp.ini, /etc/php.d/soap.ini, /etc/php.d/sqlite3.ini, /etc/php.d/wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlrpc.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zend_extensions_psa.ini, /etc/php.d/zip.ini

Here is what shows up when I try to edit /var/www/vhosts/mysticalmindtraining.org/etc/php.ini (using vi):

; ATTENTION!
;
; DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
; SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

[PHP]
tidy.clean_output = Off
include_path = ".:"
mysql.allow_persistent = On
mysql.max_links = -1
safe_mode_allowed_env_vars = PHP_
session.bug_compat_42 = Off
mysql.connect_timeout = 60
session.use_only_cookies = 1
register_argc_argv = Off
open_basedir = "/var/www/vhosts/mysticalmindtraining.org/:/tmp/"
session.name = PHPSESSID
session.hash_function = 0
magic_quotes_runtime = Off
log_errors_max_len = 1024
mssql.secure_connection = Off
pgsql.max_links = -1
variables_order = "GPCS"
"php.ini" 140L, 3556C

Does this indicate anything to you?

Thanks again so much for troubleshooting this with me,
Jason

In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jason,
that file is controlled by Plesk: I'm not expert but it should be edited via CLI or Web GUI.
Looking at http://download1.parallels.com/Plesk/PP11/11.5/Doc/en-US/pdf/plesk-administrator-guide.pdf, pg. 54, there're several layers contributing in defining your php.ini skeleton so you should ask to your hosting provider to let the change be persistent: the relevant doc seems to be ftp://download1.sw-soft.com/Plesk/Doc/en-US/online/plesk-linux-advanced-administration-guide/index.htm?fileName=69310.htm.

Google says:

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Hi Matteo,

Thanks for finding all that info for me! I went ahead and followed the instructions in the last link you provided (http://www.statamicthemes.com/articles/setting-time-zone-settings-plesk) and I believe that cleared up the time zone issue. In the Moodle "admin/phpinfo.php" area, the "date.timezone" directive now shows up as "America/Denver" (instead of "no value"). Also when running a fresh Cron (with debugging activated at the developer level), the warning messages about the "date.timezone" setting no longer appear. I ran Cron once before making the change in Plesk, and then again immediately after and it seems clear that the update in Plesk is what cleared up those warning messages. The newest Cron output is attached.

However, I've tried making a few comments on different users assignment submissions and the e-mail notifications still do not seem to be coming through, while teachers are continuing to receive assignment submission e-mail notifications immediately.

Do you have any other possible ideas come to mind? Or perhaps any other types of troubleshooting tests I can perform to help pinpoint the issue?

Thanks again,
Jason

In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Jason,
so PHP configuration is now fine at least for date management.
Let's now go back to the Send notification emails tick not working as expected; the facts are:

  • it is possible that the issue could be related with the Moodle instance migration even if the issue has been raised many days after the migration took place;
  • cron is now happily running.

AFAIK notifications depends on user preferences i.e. the tick above should force the preference and when tracking draft files has been configured (Enable Send for marking): did some change happen in the way assignments are configured in your instance or in the way teachers are using them? Are they missing to proceed with Save all my feedback?

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Hi Matteo,

Around January 19-20th all of my tests started working. I'm not sure why, other than that I had one thought that perhaps the time zone change didn't immediately fully take effect. I made comments on assignment submissions from 3 or 4 different accounts, and they all went through (sometimes it took a couple hours, but they were going through). Then, I had a teacher try making a comment on another student's account (completely bypassing my account), and interestingly, that one didn't go through until I manually ran cron.php…but it did go through. I then asked the same teacher to make another comment on the same student's account (in order to see how long it would take for the notification to go through without manually running cron). This was three days ago and the student still hasn't received the notification (even after I did go ahead with a manual cron yesterday). I tried a few more tests today, and nothing seems to be going through, even after running cron again.

I agree, it is possible the issue is related with the migration. However, I've been collecting more clues and it looks like there's a good chance that this issue may have been occurring intermittently since before the migration took place (as early as May, 2013). There have been no configuration changes that I'm aware of since the migration. I also have a few semi-reliable reports that other students have received the assignment comment notification e-mails as recently as October (i.e. after the migration took place in late July).

So, this seems like it could be an intermittent issue, which certainly makes it more difficult to troubleshoot.

In response to your other points:
All of the assignments in our system are "Online Text" assignments. I believe that the Enable Send for marking option is only available for "Advanced Uploading of Files" assignments. Interestingly, when I make comments on a student's assignment submission, I do not see the Save all my feedback option. I'm not sure why this is.

I have attached a couple screenshots:
1) "Assignment Comments.png": This is what it looks like when I am making comments on a submission.
2) "Online Text Assignment Page Settings and User Profile Settings.png": The top image shows the settings for one of our assignment pages. The bottom image shows the individual profile settings for the Student who should be receiving the assignment comment notification e-mail (but currently is not receiving any e-mails, aside from a couple that managed to go through on the 19th and 20th).

Here are a few links to the cron output from the last few days (debugging not enabled). The ones from the 22nd and the 24th do seem a bit strange and might offer some more clues.
http://mysticalmindtraining.org/20140122cron.txt
http://mysticalmindtraining.org/20140123cron.txt
http://mysticalmindtraining.org/20140124cron.txt

Thanks yet again,
Jason

Attachment Assignment Comments.png
Attachment Online Text Assignment Page Settings and User Profile Settings.png
In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Update:
The two test comments I sent out today actually did come through eventually.

The issue still does not feel completely resolved to me, since my friend still hasn't received the second test from the teacher from 3 days ago.

May I ask, is this the correct configuration to force cron to run every half hour?

/opt/php54/bin/php -q -O /dev/null http://www.mysticalmindtraining.org/admin/cron.php

I recently updated this command from the following directive:

wget -q -O /dev/null http://www.mysticalmindtraining.org/admin/cron.php

I will continue my testing. Perhaps there's an issue with the comment that the teacher sent three days ago, as that is technically the only comment that we're sure has not come through.
Jason

Attachment screenshot.jpg
In reply to Jason Press

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Ken Task -
Picture of Particularly helpful Moodlers

Are all the EMails going to the same domain?  What are the domains of the users EMail addresses that don't get notifications?   Much more is involved in the delivery of mail and one must remember EMail is not the primary function of Moodle.   If the logs of the Moodle server show the messages were successfully sent by the MTA or the logs of the SMTP server show they were successfully relayed, then it could be the mail systems themselves.

Example: If the Moodle server itself doesn't have SPF (sender policy framework) DNS records, some mail gateways will just blow the message to data bits ... and not notify sending server of reasons.   Same could be true IF all messages are routed via an SMTP server.

You might also include researching *all* mail servers involved in the whole process of EMail.

'spirit of sharing', Ken

In reply to Ken Task

Re: Send notification emails function is not working in Moodle 1.9.5+.

by Jason Press -

Thanks Ken,

To answer your question, the domains of the users' e-mail addresses are quite varied (Gmail, Yahoo, international addresses, etc.).

I appreciate your help with this very much, but fortunately, the issue now seems to be resolved. After running a number of tests, I noticed that the e-mail notifications would go through (although not immediately) after I would manually run the cron script (by going to mysticalmindtraining.com/admin/crop.php). I had a feeling that the root of the issue was related to cron and, after making a small setting change on the server, everything seems to be working correctly now.

The change I made was under the "Scheduled Tasks" section (Parallels Plesk 11.0.9) for the domain, where I had configured cron to run every half hour. On a side note, the command that seems to work best for me is "wget -q -O /dev/null http://www.mysticalmindtraining.org/admin/cron.php" but the setting change that I made to resolve the issue was actually in the "Minute" field. I used to have "0,30" and I changed it to */30 (and then again to */15). After making that change, everything has been working as would normally be expected (i.e. all notifications are going through and are received usually within 15 minutes).

If anyone has any thoughts or comments about this, I'd be interested to hear them, but otherwise, I feel this issue is resolved. Thanks again Ken and I'd also like to send a big thank you to you, Matteo, for helping me through the troubleshooting process. That was invaluable!

Blessings,
Jason