Removed boolean return and added a comment (#237)

This commit is contained in:
Mark Nelson 2018-12-17 14:11:11 +08:00
parent 3e2e9c9c8b
commit f1d6813889

View file

@ -62,7 +62,7 @@ class email_certificate_task extends \core\task\scheduled_task {
OR c.emailteachers = :emailteachers
OR $emailotherslengthsql >= 3)";
if (!$customcerts = $DB->get_records_sql($sql, array('emailstudents' => 1, 'emailteachers' => 1))) {
return false;
return;
}
// The renderers used for sending emails.
@ -149,11 +149,12 @@ class email_certificate_task extends \core\task\scheduled_task {
}
}
// Now, email the people we need to.
// If there are no users to email we can return early.
if (!$issuedusers) {
continue;
}
// Now, email the people we need to.
foreach ($issuedusers as $user) {
$userfullname = fullname($user);