Commit 01e17257 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Notify internally when trying to warn users with invalid email (bug #903485)

When expiry/inactivity warnings are sent, invalid email addresses
throw exceptions, so the cron script will fail.  It is better to catch
the email exception and insert an internal notification instead.  For
account expiry/inactivity, it is unlikely that the user will ever read
the warning, but it may be useful for institution membership expiry.

Change-Id: Id264aa72fd31155a4b7889aa0e172b1ed7676e58
Signed-off-by: default avatarRichard Mansfield <>
parent b47b62e1
......@@ -1355,8 +1355,8 @@ function _email_or_notify($user, $subject, $bodytext, $bodyhtml) {
try {
email_user($user, null, $subject, $bodytext, $bodyhtml);
catch (EmailDisabledException $e) {
// Send a notification instead - email is disabled for this user
catch (EmailException $e) {
// Send a notification instead - email is invalid or disabled for this user
$message = new StdClass;
$message->users = array($user->id);
$message->subject = $subject;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment