Skip to content
Browse files

Email subject for pending orders expiring.

Merged from stable.
  • Loading branch information...
1 parent 4670207 commit a0333291ba50453d9105ff5e59942560104d1dd5 ethem committed
Showing with 12 additions and 3 deletions.
  1. +12 −3 enrol/authorize/enrol.php
View
15 enrol/authorize/enrol.php
@@ -656,16 +656,21 @@ function cron()
$a = new stdClass;
$a->pending = $count;
$a->days = $CFG->an_emailexpired;
+ $subject = get_string('pendingorderssubject', 'enrol_authorize', $a);
+ $a = new stdClass;
+ $a->pending = $count;
+ $a->days = $CFG->an_emailexpired;
$a->enrolurl = "$CFG->wwwroot/$CFG->admin/users.php";
$a->url = $CFG->wwwroot."/enrol/authorize/index.php?status=".AN_STATUS_AUTH;
$message = get_string('pendingordersemail', 'enrol_authorize', $a);
$adminuser = get_admin();
- email_to_user($adminuser, $adminuser, "WARNING: PENDING PAYMENTS", $message);
+ email_to_user($adminuser, $adminuser, $subject, $message);
if (!empty($CFG->an_teachermanagepay) and !empty($CFG->an_emailexpiredteacher)) {
$sql = "SELECT DISTINCT E.courseid, COUNT(E.courseid) AS count " .
"FROM {$CFG->prefix}enrol_authorize E " .
"WHERE $select GROUP BY E.courseid";
- $message = ''; $lastcourse = 0; $lastcount = 0;
+ $message = ''; $subject = '';
+ $lastcourse = 0; $lastcount = 0;
$courseidandcounts = get_records_sql($sql);
foreach($courseidandcounts as $courseidandcount) {
if ($lastcourse != $courseidandcount->courseid) {
@@ -674,6 +679,10 @@ function cron()
$a = new stdClass;
$a->pending = $lastcount;
$a->days = $CFG->an_emailexpired;
+ $subject = get_string('pendingorderssubject', 'enrol_authorize', $a);
+ $a = new stdClass;
+ $a->pending = $lastcount;
+ $a->days = $CFG->an_emailexpired;
$a->enrolurl = "$CFG->wwwroot/$CFG->admin/users.php";
$a->url = $CFG->wwwroot.'/enrol/authorize/index.php?course='.
$lastcourse.'&status='.AN_STATUS_AUTH;
@@ -681,7 +690,7 @@ function cron()
}
if ($teachers = get_course_teachers($lastcourse)) {
foreach ($teachers as $teacher) {
- email_to_user($teacher, $adminuser, "WARNING: PENDING PAYMENTS", $message);
+ email_to_user($teacher, $adminuser, $subject, $message);
}
}
}

0 comments on commit a033329

Please sign in to comment.
Something went wrong with that request. Please try again.